SQL SERVER 数据库错误类是:System.Data.SqlClient.SqlException ,其类继承层次如下
System.Object
System.Exception
System.SystemException
System.Runtime.InteropServices.ExternalException
System.Data.Common.DbException
System.Data.Odbc.OdbcException
System.Data.OleDb.OleDbException
System.Data.OracleClient.OracleException
System.Data.SqlClient.SqlException
System.Exception
System.SystemException
System.Runtime.InteropServices.ExternalException
System.Data.Common.DbException
System.Data.Odbc.OdbcException
System.Data.OleDb.OleDbException
System.Data.OracleClient.OracleException
System.Data.SqlClient.SqlException
其中:"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."错误对应 (ex.GetBaseException() as System.Data.SqlClient.SqlException).Number=-2,可通过此值来判断是否是超时错误,或其他错误。