差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
dotnet:sqlexception [2009/06/15 18:48] – 作成 ともやん | dotnet:sqlexception [2019/05/18 02:23] (現在) – 外部編集 非ログインユーザー | ||
---|---|---|---|
行 2: | 行 2: | ||
SqlException の Number に設定される番号の種類は以下の通りである。 | SqlException の Number に設定される番号の種類は以下の通りである。 | ||
- | 20未満はSQLServerに接続する前のエラーで、System.Data.SqlClient.TdsEnums(private class)に定義されている番号が設定される。 | + | 100以下はSQLServerに接続する前のエラーであり、.NET Framework 1.1 の場合は System.Data.SqlClient.TdsParser.ProcessNetlibError メソッド内で、以下の表のような判定を行って SQLError インスタンスを生成している。\\ |
- | ^ 番号 | + | ※.NET Framework 2.0 の場合は実装が変わっており、TdsParser.ProcessNetlibError メソッド自体が存在しない。\\ |
- | | -3|ZeroBytes | + | \\ |
- | | -2|Timeout | + | 20以下の番号はSystem.Data.SqlClient.TdsEnums(private class)に定義されている番号が設定される。 |
- | | -1|Unknown | + | ^ 番号 |
- | | 1|InsufficientMemory | + | | -3|public const short ZERO_BYTES_READ = -3; |SQL_ZeroBytes |
- | | 2|AccessDenied | + | | -2|public const short TIMEOUT_EXPIRED = -2; |SQL_Timeout |
- | | 3|ConnectionBusy | + | | -1|public const short UNKNOWN_ERROR = -1; |SQL_Unknown |
- | | 4|ConnectionBroken | + | | 1|public const short NE_E_NOMEMORY = 0x01; |SQL_InsufficientMemory |
- | | 5|ConnectionLimit | + | | 2|public const short NE_E_NOACCESS = 0x02; |SQL_AccessDenied |
- | | 6|ServerNotFound | + | | 3|public const short NE_E_CONNBUSY = 0x03; |SQL_ConnectionBusy |
- | | 7|NetworkNotFound | + | | 4|public const short NE_E_CONNBROKEN = 0x04; |SQL_ConnectionBroken |
- | | 8|InsufficientResources | + | | 5|public const short NE_E_TOOMANYCONN = 0x05; |SQL_ConnectionLimit |
- | | 9|NetworkBusy | + | | 6|public const short NE_E_SERVERNOTFOUND = 0x06; |SQL_ServerNotFound |
- | | 10|NetworkAccessDenied | + | | 7|public const short NE_E_NETNOTSTARTED = 0x07; |SQL_NetworkNotFound |
- | | 11|GeneralError | + | | 8|public const short NE_E_NORESOURCE = 0x08; |SQL_InsufficientResources |
- | | 12|IncorrectMode | + | | 9|public const short NE_E_NETBUSY = 0x09; |SQL_NetworkBusy |
- | | 13|NameNotFound | + | | 10|public const short NE_E_NONETACCESS = 0x0A; |SQL_NetworkAccessDenied |
- | | 14|InvalidConnection | + | | 11|public const short NE_E_GENERAL = 0x0B; |SQL_GeneralError |
- | | 15|ReadWriteError | + | | 12|public const short NE_E_CONNMODE = 0x0C; |SQL_IncorrectMode |
- | | 16|TooManyHandles | + | | 13|public const short NE_E_NAMENOTFOUND = 0x0D; |SQL_NameNotFound |
- | | 17|ServerError | + | | 14|public const short NE_E_INVALIDCONN = 0x0E; |SQL_InvalidConnection |
- | | 18|SSLError | + | | 15|public const short NE_E_NETDATAERR = 0x0F; |SQL_ReadWriteError |
- | | 19|EncryptionError | + | | 16|public const short NE_E_TOOMANYFILES = 0x10; |SQL_TooManyHandles |
- | | 20|EncryptionNotSupported | + | | 17|public const short NE_E_SERVERERROR = 0x11; |SQL_SevereError |
- | 20より大きい番号は SQLServer の master データベースの dbo.sysmessages テーブルに定義されているものが発生する。 | + | | 18|public const short NE_E_SSLSECURITYERROR = 0x12; |SQL_SSLError |
+ | | 19|public const short NE_E_ENCRYPTIONON = 0x13; |SQL_EncryptionError | ||
+ | | 20|public const short NE_E_ENCRYPTIONNOTSUPPORTED = 0x14; |SQL_EncryptionNotSupported | ||
+ | \\ | ||
+ | 21、および、101以上の番号は SQLServer の master データベースの dbo.sysmessages テーブルに定義されているものが発生する。\\ | ||
+ | 53などのように winerror.h に定義されている Win32エラーコードが設定される場合もある。\\ | ||
+ | \\ | ||
+ | [SQL]\\ | ||
+ | <code sql> | ||
+ | use master | ||
+ | select * from dbo.sysmessages where msglangid = 1041 | ||
+ | </ | ||
+ | {{: | ||
+ | \\ | ||
+ | で、結局何を信用すればいいか?\\ | ||
+ | .NET Framework 2.0 以降のデータプロバイダは、[[http:// | ||
+ | \\ | ||
参考文献: | 参考文献: | ||
- | [[http:// | + | [[http:// |
+ | [[http:// |