none
System.Data.SqlClient.SqlException : Number property RRS feed

  • Question

  •  

    In dotnet, a System.Data.SqlClient.SqlException has a 'Number' property.
    This number corresponds with the 'message_id' of the table sys.messages of the master database on SQL Server.
    I am looking for the value of the Number property for the following System.Data.SqlClient.SqlExceptions :

     

    * General network error. Check your network documentation.

    * SQL server does not exist or access is denied.

    * Specified SQL server not found.

     

    What is the value of the Number property of these SqlExceptions or how can I find the value? Thanks!

    Thursday, August 14, 2008 11:24 AM

Answers

  • Please take a look at the following forum post that also discusses possible values for the SqlException.Number property:

    http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/aa0cac26-cb3d-4cd3-a884-1106b9337f90/

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, April 1, 2009 11:44 PM
    Moderator
  • Here is the possible values you want to have:

    17829: A network error occurred while establishing a connection; the connection has been closed.%.*ls

    17830: Network error code 0x%x occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration. Time spent during login: total %d ms, enqueued %d ms, network writes %d ms, network r

    1418: The server network address "%.*ls" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational.

    If you have SqlServer installed, you may run the query command like

    select

    * from master.dbo.sysmessages where description like '%network%'

    to get more related errors values.

    Wednesday, April 1, 2009 11:58 PM
    Answerer

All replies

  • Hi Ann,

    can you provide us with more information on how you generate these SqlExceptions? Have you also tried a network monitor to view the response from sql server. That might contain more information on the SqlExceptions.

    Thanks.
    Tuesday, March 31, 2009 9:22 PM
  • Please take a look at the following forum post that also discusses possible values for the SqlException.Number property:

    http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/aa0cac26-cb3d-4cd3-a884-1106b9337f90/

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, April 1, 2009 11:44 PM
    Moderator
  • Here is the possible values you want to have:

    17829: A network error occurred while establishing a connection; the connection has been closed.%.*ls

    17830: Network error code 0x%x occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration. Time spent during login: total %d ms, enqueued %d ms, network writes %d ms, network r

    1418: The server network address "%.*ls" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational.

    If you have SqlServer installed, you may run the query command like

    select

    * from master.dbo.sysmessages where description like '%network%'

    to get more related errors values.

    Wednesday, April 1, 2009 11:58 PM
    Answerer