Export (0) Print
Expand All

DacException Class

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

Namespace:  Microsoft.SqlServer.Management.Dac
Assembly:  Microsoft.SqlServer.Management.Dac (in Microsoft.SqlServer.Management.Dac.dll)

[SerializableAttribute]
public class DacException : SqlServerManagementException

The DacException type exposes the following members.

  NameDescription
Public methodDacException()Initializes a new instance of the DacException class.
Public methodDacException(String)Initializes a new instance of the DacException class that has the specified message text.
Protected methodDacException(SerializationInfo, StreamingContext)Initializes a new instance of the DacException class specifying a location to stream serialized information.
Public methodDacException(String, Exception)Initializes a new instance of the DacException class that has the specified message text and inner exception.
Top

  NameDescription
Public propertyDacExceptionTypeGets the type of the exception.
Public propertyData (Inherited from Exception.)
Public propertyHelpLinkGets a string with the URL help link that further explains the exception. (Overrides Exception.HelpLink.)
Protected propertyHResult (Inherited from Exception.)
Public propertyInnerException (Inherited from Exception.)
Public propertyMessage (Inherited from Exception.)
Protected propertyStatic memberProdVerGets the product version.
Public propertySource (Inherited from Exception.)
Public propertyStackTrace (Inherited from Exception.)
Public propertyTargetSite (Inherited from Exception.)
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetBaseException (Inherited from Exception.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetObjectData (Inherited from Exception.)
Public methodGetType (Inherited from Exception.)
Protected methodInitInitializes provider properties.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodSetHelpContextSets the help context for the help link.
Public methodToString (Inherited from Exception.)
Top

Using the DacException class, you can:

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft