Share via


Clase DacException

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

Espacio de nombres:  Microsoft.SqlServer.Management.Dac
Ensamblado:  Microsoft.SqlServer.Management.Dac (en Microsoft.SqlServer.Management.Dac.dll)

Sintaxis

'Declaración
<SerializableAttribute> _
Public Class DacException _
    Inherits SqlServerManagementException
'Uso
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

El tipo DacException expone los siguientes miembros.

Constructores

  Nombre Descripción
Método público DacException() () () () Initializes a new instance of the DacException class.
Método público DacException(String) Initializes a new instance of the DacException class that has the specified message text.
Método protegido DacException(SerializationInfo, StreamingContext) Initializes a new instance of the DacException class specifying a location to stream serialized information.
Método público DacException(String, Exception) Initializes a new instance of the DacException class that has the specified message text and inner exception.

Arriba

Propiedades

  Nombre Descripción
Propiedad pública DacExceptionType Gets the type of the exception.
Propiedad pública Data (Se hereda de Exception.)
Propiedad pública HelpLink Gets a string with the URL help link that further explains the exception. (Invalida Exception. . :: . .HelpLink.)
Propiedad protegida HResult (Se hereda de Exception.)
Propiedad pública InnerException (Se hereda de Exception.)
Propiedad pública Message (Se hereda de Exception.)
Propiedad protegidaMiembro estático ProdVer Gets the product version.
Propiedad pública Source (Se hereda de Exception.)
Propiedad pública StackTrace (Se hereda de Exception.)
Propiedad pública TargetSite (Se hereda de Exception.)

Arriba

Métodos

  Nombre Descripción
Método público Equals (Se hereda de Object.)
Método protegido Finalize (Se hereda de Object.)
Método público GetBaseException (Se hereda de Exception.)
Método público GetHashCode (Se hereda de Object.)
Método público GetObjectData (Se hereda de Exception.)
Método público GetType (Se hereda de Exception.)
Método protegido Init Initializes provider properties.
Método protegido MemberwiseClone (Se hereda de Object.)
Método protegido SetHelpContext Sets the help context for the help link.
Método público ToString (Se hereda de Exception.)

Arriba

Comentarios

Using the DacException class, you can:

Thread Safety

Todos los miembros estáticos (compartidos en Microsoft Visual Basic) públicos de este tipo son seguros para operaciones multiproceso. No se garantiza que los miembros de instancia sean seguros para subprocesos.

Ejemplos

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

Seguridad para subprocesos

Cualquier miembro público static (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancia sean seguros para subprocesos.