DbException 建構函式

定義

初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class.

多載

DbException()

初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class.

DbException(String)

使用指定的錯誤訊息,初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified error message.

DbException(SerializationInfo, StreamingContext)

使用指定的序列化資訊和內容,初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified serialization information and context.

DbException(String, Exception)

初始化具有指定的錯誤訊息以及造成此例外狀況的內部例外狀況參考之 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified error message and a reference to the inner exception that is the cause of this exception.

DbException(String, Int32)

使用指定的錯誤訊息和錯誤碼,初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified error message and error code.

備註

DbException類別是抽象類別,用來做為提供者特定例外狀況類別的基類。The DbException class is an abstract class used as the base class for provider-specific exception class implementations.

DbException()

初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class.

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

備註

DbException類別是抽象類別,用來做為提供者特定例外狀況類別的基類。The DbException class is an abstract class used as the base class for provider-specific exception class implementations.

適用於

DbException(String)

使用指定的錯誤訊息,初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified error message.

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

顯示這個例外狀況的訊息。The message to display for this exception.

備註

DbException類別是抽象類別,用來做為提供者特定例外狀況類別的基類。The DbException class is an abstract class used as the base class for provider-specific exception class implementations.

適用於

DbException(SerializationInfo, StreamingContext)

使用指定的序列化資訊和內容,初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified serialization information and context.

protected:
 DbException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected DbException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
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,包含所擲回之例外狀況的相關序列化物件資料。The SerializationInfo that holds the serialized object data about the exception being thrown.

context
StreamingContext

包含有關來源或目的端內容資訊的 StreamingContextThe StreamingContext that contains contextual information about the source or destination.

備註

DbException類別是抽象類別,用來做為提供者特定例外狀況類別的基類。The DbException class is an abstract class used as the base class for provider-specific exception class implementations.

適用於

DbException(String, Exception)

初始化具有指定的錯誤訊息以及造成此例外狀況的內部例外狀況參考之 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified error message and a reference to the inner exception that is the cause of this exception.

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

錯誤訊息字串。The error message string.

innerException
Exception

內部例外狀況參考。The inner exception reference.

備註

DbException類別是抽象類別,用來做為提供者特定例外狀況類別的基類。The DbException class is an abstract class used as the base class for provider-specific exception class implementations.

適用於

DbException(String, Int32)

使用指定的錯誤訊息和錯誤碼,初始化 DbException 類別的新執行個體。Initializes a new instance of the DbException class with the specified error message and error code.

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

解釋例外狀況原因的錯誤訊息。The error message that explains the reason for the exception.

errorCode
Int32

例外狀況的錯誤碼。The error code for the exception.

備註

DbException類別是抽象類別,用來做為提供者特定例外狀況類別的基類。The DbException class is an abstract class used as the base class for provider-specific exception class implementations.

適用於