Re: Handling exceptions

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Cor Ligthert[MVP] wrote:
"Arne Vajhøj" <arne@xxxxxxxxxx> schreef in bericht news:489f78cd$0$90269$14726298@xxxxxxxxxxxxxxxxxx
Cor Ligthert[MVP] wrote:
Jon,
And of course nothing *ever* goes wrong with valid SQL... The database
never goes down, there are never concurrency violations, locking
problems, failing to find expected data etc.

As far as I know them will the SQLException ignore all of those problems you are showing

The SQLexception is needed to check if a stored procedure or an parameter in that does not exist.
But you are in my opinion a jerk of a developer as you are testing that at run time.

No.

ADO.NET does not return status values.

Either it is a success all the way through or you get an
exception.

The only bad thing about the exception is that you get the
same exception type for too many different problems. I guess
that will be fixed in .NET 4.0 or 5.0 !
Can you point me where your answer is about. I don't have the idea to have written anything about a Status.

There are only two alternatives for returning errors: exceptions and
status codes. So since .NET does not have status codes, then the
choices are somewhat limited-

But what you wrote is in my opinion true, although you can catch with the SQLException some information why the SQL transaction on the Server Side went wrong.

You can, but that is very bad OOP.

However, in my opinion a designer should fix all those errors which are catched here fix before he gives his program in production.

None of the problems Jon list is permanent problems. They can
happen in production even if they do not happen in test.

And even if the database server did go down under test, then I am not
quite sure what the designer should fix ? Not use a database ??

> (Or catch them at client side as it is hardware dependend, I
have never seen a server, which was down, give any information)

I am not quite sure what you mean by client and server here, but
since it is about database access let us assume database client
and server.

If the database server si down, then the database client will
get an exception and need to handle it. Like Jon explained.

Arne
.



Relevant Pages

  • Re: Enterprise Library and PostgreSQL (Npgsql)
    ... I found the database provider code at ... Catch ex As Exception ... If the connection string is invalid or the database server is ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework)
  • Re: SQL Server 2000 Hardware Recommendations?
    ... Are you using stored procedures or adhoc sql calls? ... > and database server as we expand our web site to have more dynamic ... Currently the database server houses all data pertinent to ...
    (microsoft.public.sqlserver.server)
  • Re: Is file is being used
    ... The file system doesn't know anything about the content of the .mdb file. ... That said, most database do support multiple users, and they do so by ... Note that even in the case of a database server supporting multiple ...
    (microsoft.public.dotnet.languages.csharp)
  • Object reference not set to an instance of an object.
    ... Object reference not set to an instance of an object. ... An unhandled exception occurred during the execution of the ... Dim myJobRequest As New skillsDB.jobRequest ... Session= "The skills database has been updated ...
    (microsoft.public.dotnet.general)
  • SQL Server 2000 Hardware Recommendations?
    ... and database server as we expand our web site to have more dynamic ... Currently the database server houses all data pertinent to ... under a heavy load, a sql-heavy page can take as long as 90 seconds to ...
    (microsoft.public.sqlserver.server)