DbException 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
代表数据源引发的所有异常的基类。
public ref class DbException abstract : Exception
	public ref class DbException abstract : System::Runtime::InteropServices::ExternalException
	public abstract class DbException : Exception
	public abstract class DbException : System.Runtime.InteropServices.ExternalException
	[System.Serializable]
public abstract class DbException : System.Runtime.InteropServices.ExternalException
	type DbException = class
    inherit Exception
	type DbException = class
    inherit ExternalException
	[<System.Serializable>]
type DbException = class
    inherit ExternalException
	Public MustInherit Class DbException
Inherits Exception
	Public MustInherit Class DbException
Inherits ExternalException
		- 继承
 
- 继承
 
- 派生
 
- 属性
 
注解
DbException 类是一个抽象类,用作提供程序特定的异常类实现的基类。
有关处理 .NET Framework 数据提供程序异常的一般信息,请参阅 SqlException。
构造函数
| DbException() | 
		 初始化 DbException 类的新实例。  | 
        	
| DbException(SerializationInfo, StreamingContext) | 
			 
				已过时.
			 
		使用指定的序列化信息和上下文初始化 DbException 类的新实例。  | 
        	
| DbException(String, Exception) | 
		 使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 DbException 类的新实例。  | 
        	
| DbException(String, Int32) | 
		 使用指定的错误消息和错误代码初始化 DbException 类的新实例。  | 
        	
| DbException(String) | 
		 使用指定的错误消息初始化 DbException 类的新实例。  | 
        	
属性
| BatchCommand | 
		 如果在执行 DbBatch时引发此 DbException,则引用触发异常的特定 DbBatchCommand。  | 
        	
| Data | 
		 获取键/值对的集合,这些键/值对提供有关异常的其他用户定义的信息。 (继承自 Exception) | 
        	
| DbBatchCommand | 
		 在派生类中重写时,如果在执行 DbBatch时引发此 DbException,则引用触发异常的特定 DbBatchCommand。  | 
        	
| ErrorCode | 
		 获取错误的   | 
        	
| HelpLink | 
		 获取或设置与此异常关联的帮助文件的链接。 (继承自 Exception) | 
        	
| HResult | 
		 获取或设置 HRESULT,它是分配给特定异常的编码数值。 (继承自 Exception) | 
        	
| InnerException | 
		 获取导致当前异常的 Exception 实例。 (继承自 Exception) | 
        	
| IsTransient | 
		 指示此 DbException 所表示的错误是否可能是暂时性错误,即如果重试触发操作可能会成功,而没有任何其他更改。  | 
        	
| Message | 
		 获取描述当前异常的消息。 (继承自 Exception) | 
        	
| Source | 
		 获取或设置导致错误的应用程序或对象的名称。 (继承自 Exception) | 
        	
| SqlState | 
		 对于支持它的数据库提供程序,包含指示数据库操作成功或失败的标准 SQL 5 字符返回代码。 前 2 个字符表示返回代码的 类(例如错误,成功),而最后 3 个字符表示 子类,从而允许以数据库可移植的方式检测错误方案。  对于不支持它的数据库提供程序,或对于不可应用的错误方案,包含   | 
        	
| StackTrace | 
		 获取调用堆栈上即时帧的字符串表示形式。 (继承自 Exception) | 
        	
| TargetSite | 
		 获取引发当前异常的方法。 (继承自 Exception) | 
        	
方法
| Equals(Object) | 
		 确定指定的对象是否等于当前对象。 (继承自 Object) | 
        	
| GetBaseException() | 
		 在派生类中重写时,返回一个或多个后续异常的根本原因 Exception。 (继承自 Exception) | 
        	
| GetHashCode() | 
		 用作默认哈希函数。 (继承自 Object) | 
        	
| GetObjectData(SerializationInfo, StreamingContext) | 
			 
		已过时.
	 
在派生类中重写时,使用有关异常的信息设置 SerializationInfo。 (继承自 Exception) | 
        	
| GetType() | 
		 获取当前实例的运行时类型。 (继承自 Exception) | 
        	
| MemberwiseClone() | 
		 创建当前 Object的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		 创建并返回当前异常的字符串表示形式。 (继承自 Exception) | 
        	
| ToString() | 
		 返回包含错误的 HRESULT 的字符串。 (继承自 ExternalException) | 
        	
事件
| SerializeObjectState | 
			 
		已过时.
	 
序列化异常以创建包含有关异常的序列化数据的异常状态对象时发生。 (继承自 Exception) |