Environment: .NET 1.1, SQL 2000, VS.NET 2003.
We have some logic in an application to perform some recovery operation
on the client side based on the SQL error code returned from
System.Data.SqlClient.SqlError. It seems to me that the Number
property in System.Data.SqlClient.SqlError is a perfect fit.
According to the manual page, The Number property in
System.Data.SqlClient.SqlError corresponds to an entry in the
master.dbo.sysmessages table. I managed to get some numbers not listed
in the master.dbo.sysmessages table: 11 (General network error. Check
your network documentation), and 17 (SQL Server does not exist or
access denied). It is reasonable that these network related errors do
not appear in the master.dbo.sysmessages table. However, I was
wondering, in addition to 11 and 17, what are other possible error code
(returned by Number property in System.Data.SqlClient.SqlError) not
listed in master.dbo.sysmessages table???
I remember that ODBC (in unmanaged C/C++ code) has very detailed
description for EACH error code and sql state, and people always
suggest that we use System.Data.SqlClient instead of System.Data.Odbc.
I already tried MSDN as well as google various places without luck.
Or is there any other way to do what I wish to do?
Any hints/suggestions are appreciated.
Thanks.
Kong