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