DbException 建構函式

定義

初始化 DbException 類別的新執行個體。

多載

名稱 Description
DbException()

初始化 DbException 類別的新執行個體。

DbException(String)

初始化該類別的新實例 DbException ,並以指定的錯誤訊息。

DbException(SerializationInfo, StreamingContext)
已淘汰.

初始化一個新的類別實例 DbException ,並附上指定的序列化資訊與上下文。

DbException(String, Exception)

初始化一個新的類別實例 DbException ,並附上指定的錯誤訊息及導致該例外的內部例外的參考。

DbException(String, Int32)

初始化一個新的類別實例 DbException ,並附上指定的錯誤訊息與錯誤碼。

備註

這個 DbException 類別是一個抽象類別,用作提供者專屬例外類別實作的基底類別。

DbException()

來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs

初始化 DbException 類別的新執行個體。

protected:
 DbException();
protected DbException();
Protected Sub New ()

備註

這個 DbException 類別是一個抽象類別,用作提供者專屬例外類別實作的基底類別。

另請參閱

適用於

DbException(String)

來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs

初始化該類別的新實例 DbException ,並以指定的錯誤訊息。

protected:
 DbException(System::String ^ message);
protected DbException(string message);
protected DbException(string? message);
new System.Data.Common.DbException : string -> System.Data.Common.DbException
Protected Sub New (message As String)

參數

message
String

此例外顯示的訊息。

備註

這個 DbException 類別是一個抽象類別,用作提供者專屬例外類別實作的基底類別。

另請參閱

適用於

DbException(SerializationInfo, StreamingContext)

來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs

警告

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

初始化一個新的類別實例 DbException ,並附上指定的序列化資訊與上下文。

protected:
 DbException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected DbException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected DbException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Data.Common.DbException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Data.Common.DbException
new System.Data.Common.DbException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Data.Common.DbException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

參數

info
SerializationInfo

SerializationInfo 個 保留了關於被拋出例外的序列化物件資料。

context
StreamingContext

the that StreamingContext 包含了關於來源或目的地的上下文資訊。

屬性

備註

這個 DbException 類別是一個抽象類別,用作提供者專屬例外類別實作的基底類別。

另請參閱

適用於

DbException(String, Exception)

來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs

初始化一個新的類別實例 DbException ,並附上指定的錯誤訊息及導致該例外的內部例外的參考。

protected:
 DbException(System::String ^ message, Exception ^ innerException);
protected DbException(string message, Exception innerException);
protected DbException(string? message, Exception? innerException);
new System.Data.Common.DbException : string * Exception -> System.Data.Common.DbException
Protected Sub New (message As String, innerException As Exception)

參數

message
String

錯誤訊息字串。

innerException
Exception

內部例外的參考。

備註

這個 DbException 類別是一個抽象類別,用作提供者專屬例外類別實作的基底類別。

另請參閱

適用於

DbException(String, Int32)

來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs
來源:
DbException.cs

初始化一個新的類別實例 DbException ,並附上指定的錯誤訊息與錯誤碼。

protected:
 DbException(System::String ^ message, int errorCode);
protected DbException(string? message, int errorCode);
protected DbException(string message, int errorCode);
new System.Data.Common.DbException : string * int -> System.Data.Common.DbException
Protected Sub New (message As String, errorCode As Integer)

參數

message
String

說明例外狀況原因的錯誤訊息。

errorCode
Int32

例外的錯誤代碼。

備註

這個 DbException 類別是一個抽象類別,用作提供者專屬例外類別實作的基底類別。

另請參閱

適用於