Класс 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

Все общие статические члены этого типа (Shared в Microsoft Visual Basic) можно использовать в многопоточных операциях. Безопасная многопоточная работа с членами экземпляров типа не гарантируется.

Примеры

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."); 
} 

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.