.NET 3.5 アプリのログで を取得しています。SqlException
対応する番号 (プロパティの値) を探していますSqlException.Number
。
System.Data.SqlClient.SqlException: A transport-level error has occurred
when receiving results from the server. (provider: TCP Provider, error: 0
- The specified network name is no longer available.) at
System.Data.SqlClient.SqlConnection.OnError
次のようなエラーも表示されます。
System.Data.SqlClient.SqlException: A network-related or instance-specific error
occurred while establishing a connection to SQL Server. The server was not found
or was not accessible. Verify that the instance name is correct and that SQL Server
is configured to allow remote connections.
これらの例外を適切にキャッチする方法を知っている人はいますか? (ここに回答を投稿することもできます)