DacException 类

The DacException class is a generic exception that is raised when an error occurs using the Microsoft.SqlServer.Management.Dac namespace.

命名空间:  Microsoft.SqlServer.Management.Dac
程序集:  Microsoft.SqlServer.Management.Dac(在 Microsoft.SqlServer.Management.Dac.dll 中)

语法

声明
<SerializableAttribute> _
Public Class DacException _
    Inherits SqlServerManagementException
用法
Dim instance As DacException
[SerializableAttribute]
public class DacException : SqlServerManagementException
[SerializableAttribute]
public ref class DacException : public SqlServerManagementException
[<SerializableAttribute>]
type DacException =  
    class
        inherit SqlServerManagementException
    end
public class DacException extends SqlServerManagementException

DacException 类型公开以下成员。

构造函数

  名称 说明
公共方法 DacException() () () () Initializes a new instance of the DacException class.
公共方法 DacException(String) Initializes a new instance of the DacException class that has the specified message text.
受保护方法 DacException(SerializationInfo, StreamingContext) Initializes a new instance of the DacException class specifying a location to stream serialized information.
公共方法 DacException(String, Exception) Initializes a new instance of the DacException class that has the specified message text and inner exception.

页首

属性

  名称 说明
公共属性 DacExceptionType Gets the type of the exception.
公共属性 Data (从 Exception 继承。)
公共属性 HelpLink Gets a string with the URL help link that further explains the exception. (覆盖 Exception. . :: . .HelpLink。)
受保护属性 HResult (从 Exception 继承。)
公共属性 InnerException (从 Exception 继承。)
公共属性 Message (从 Exception 继承。)
受保护属性静态成员 ProdVer Gets the product version.
公共属性 Source (从 Exception 继承。)
公共属性 StackTrace (从 Exception 继承。)
公共属性 TargetSite (从 Exception 继承。)

页首

方法

  名称 说明
公共方法 Equals (从 Object 继承。)
受保护方法 Finalize (从 Object 继承。)
公共方法 GetBaseException (从 Exception 继承。)
公共方法 GetHashCode (从 Object 继承。)
公共方法 GetObjectData (从 Exception 继承。)
公共方法 GetType (从 Exception 继承。)
受保护方法 Init Initializes provider properties.
受保护方法 MemberwiseClone (从 Object 继承。)
受保护方法 SetHelpContext Sets the help context for the help link.
公共方法 ToString (从 Exception 继承。)

页首

注释

Using the DacException class, you can:

Thread Safety

此类型的任何公共静态(Microsoft Visual Basic 中的 Shared)成员在多线程操作中是安全的。不保证所有实例成员都是线程安全的。

示例

VC#

try 
{ 
    //Enter DAC code here. 
 
} 
//Catch the DAC exception.
catch (DacException dacex) 
{ 
    System.Console.WriteLine("This is a DAC Exception"); 
   //Display the DAC exception message and type. 
   System.Console.WriteLine(dacex.Message); 
   System.Console.WriteLine(dacex.DacExceptionType); 
} 
   //Catch other non-DAC exceptions. 
catch (Exception ex) 
{ 
   System.Console.WriteLine("This is not a DAC exception."); 
} 

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。