语言

DbException 构造函数

定义

初始化 DbException 类的新实例。

重载

名称 说明
DbException()

初始化 DbException 类的新实例。

DbException(String)

使用指定的错误消息初始化类的新实例 DbException 。

DbException(SerializationInfo, StreamingContext)
已过时.

使用指定的序列化信息和上下文初始化 DbException 类的新实例。

DbException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 DbException 类的新实例。

DbException(String, Int32)

使用指定的错误消息和错误代码初始化 DbException 类的新实例。

注解

DbException 类是一个抽象类,用作提供程序特定的异常类实现的基类。

DbException()

Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs

初始化 DbException 类的新实例。

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

注解

DbException 类是一个抽象类,用作提供程序特定的异常类实现的基类。

另请参阅

适用于

DbException(String)

Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
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)

Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
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

包含有关源或目标的上下文信息的 StreamingContext。

属性

注解

DbException 类是一个抽象类,用作提供程序特定的异常类实现的基类。

另请参阅

适用于

DbException(String, Exception)

Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
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)

Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
DbException.cs
Source:
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 类是一个抽象类,用作提供程序特定的异常类实现的基类。

另请参阅

适用于