documenation for '.NET Data Provider for SQL Server' errors

V

Vikram Vamshi

Hi,
I was trying to find documenation for the error messages and the
corresponding error numbers for the errors that are raised by the .net data
provider for SQL Server.

For example:
The following is the message when the provider times out
Timeout expired. The timeout period elapsed prior to completion of the
operation or the server is not responding.
and the corresponding error number is:-2

I was trying to get a list of all the possible errors along with their error
numbers, so that we can handle them in our code if it is appropriate.
It would help us a lot if someone can point me to the documentation.

Thanks in advance.
 
S

Sahil Malik [MVP]

Okay, before I can answer the below, I need to ask you another question :)

Are you talking about errors that occur in TSQL? (Because that is what kinda
sounds like from your description - Error Numbers i.e), or are you talking
about Errors that occur in ADO.NET?

Also, if it is ADO.NET, then are you talking about ADO.NET 2.0 or 1.1?
 
V

Vikram Vamshi

I was looking for the errors in ADO.NET 1.1 (specifically the ones for the
sql server provider)
Errors like 'Time out expired' and initiated from the client side.
 
S

Sahil Malik [MVP]

Okay so the errors are basically Exceptions, and what I'd recommend is to
pick up a tool like Reflector and try and understand the exception structure
first.

Many of these errors donot have error numbers because they are exceptions.

Once you filter out the exception structure, then you can segregate all the
errors raised by the underlying Sql Server binaries under SqlException, and
those you can get a list from SQL server books online.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------
---------------

Vikram Vamshi said:
I was looking for the errors in ADO.NET 1.1 (specifically the ones for the
sql server provider)
Errors like 'Time out expired' and initiated from the client side.
--
Vikram Vamshi
Database Engineer
Eclipsys Corporation

Sahil Malik said:
Okay, before I can answer the below, I need to ask you another question
:)

Are you talking about errors that occur in TSQL? (Because that is what
kinda
sounds like from your description - Error Numbers i.e), or are you talking
about Errors that occur in ADO.NET?

Also, if it is ADO.NET, then are you talking about ADO.NET 2.0 or 1.1?


--

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
--------------------------------------------------------------------------
--
 
V

Vikram Vamshi

Maybe I was not clear earlier.
If the error was raised by SQL Server, the SqlException that generated has
the proper error message and number documented in SQL books online, and our
code handles these properly.

The problem is only if it is a client side exception (like timeout expired).
I need to know all the possible client side exceptions the provider can
raise, so that we can determine how to react to it. Say if it is a driver
timeout, we will retry couple of times by incrementing the timeout value.
 
M

Mark Ashton

For System.Data.SqlClient, it will generally throw a SqlException if the
error comes from the server or for things like timeout. To distinguish
between the two, you have to start looking at the error codes and messages.

Other possible exceptions are more programming like mistakes with exceptions
like InvalidArgumentException & InvalidOperationException.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top