DacException Class
The DacException class is a generic exception that is raised when an error occurs using the Microsoft.SqlServer.Management.Dac namespace.
Inheritance Hierarchy
Object
Exception
Microsoft.SqlServer.Management.Common.SqlServerManagementException
Microsoft.SqlServer.Management.Dac.DacException
Microsoft.SqlServer.Management.Dac.BacpacException
Microsoft.SqlServer.Management.Dac.DacExtractionException
Microsoft.SqlServer.Management.Dac.DeploymentValidationException
Microsoft.SqlServer.Management.Dac.ExtractValidationException
Microsoft.SqlServer.Management.Dac.InvalidInputException
Namespace: Microsoft.SqlServer.Management.Dac
Assembly: Microsoft.SqlServer.Management.Dac (in Microsoft.SqlServer.Management.Dac.dll)
Syntax
'Déclaration
<SerializableAttribute> _
Public Class DacException _
Inherits SqlServerManagementException
'Utilisation
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
The DacException type exposes the following members.
Constructors
Name | Description | |
---|---|---|
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. |
Top
Properties
Name | Description | |
---|---|---|
DacExceptionType | Gets the type of the exception. | |
Data | (Inherited from Exception.) | |
HelpLink | Gets a string with the URL help link that further explains the exception. (Overrides ExceptionHelpLink().) | |
HResult | (Inherited from Exception.) | |
InnerException | (Inherited from Exception.) | |
Message | (Inherited from Exception.) | |
ProdVer | Gets the product version. | |
Source | (Inherited from Exception.) | |
StackTrace | (Inherited from Exception.) | |
TargetSite | (Inherited from Exception.) |
Top
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetBaseException | (Inherited from Exception.) | |
GetHashCode | (Inherited from Object.) | |
GetObjectData | (Inherited from Exception.) | |
GetType | (Inherited from Exception.) | |
Init | Initializes provider properties. | |
MemberwiseClone | (Inherited from Object.) | |
SetHelpContext | Sets the help context for the help link. | |
ToString | (Inherited from Exception.) |
Top
Remarks
Using the DacException class, you can:
Handle errors generated by the Microsoft.SqlServer.Management.Dac namespace.
Determine the cause of the error.
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.
Examples
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.");
}
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
Microsoft.SqlServer.Management.Dac Namespace