Condividi tramite


Classe DacException

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

Spazio dei nomi  Microsoft.SqlServer.Management.Dac
Assembly:  Microsoft.SqlServer.Management.Dac (in Microsoft.SqlServer.Management.Dac.dll)

Sintassi

'Dichiarazione
<SerializableAttribute> _
Public Class DacException _
    Inherits SqlServerManagementException
'Utilizzo
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

Nel tipo DacException sono esposti i membri seguenti.

Costruttori

  Nome Descrizione
Metodo pubblico DacException() () () () Initializes a new instance of the DacException class.
Metodo pubblico DacException(String) Initializes a new instance of the DacException class that has the specified message text.
Metodo protetto DacException(SerializationInfo, StreamingContext) Initializes a new instance of the DacException class specifying a location to stream serialized information.
Metodo pubblico DacException(String, Exception) Initializes a new instance of the DacException class that has the specified message text and inner exception.

In alto

Proprietà

  Nome Descrizione
Proprietà pubblica DacExceptionType Gets the type of the exception.
Proprietà pubblica Data Ereditato da Exception.
Proprietà pubblica HelpLink Gets a string with the URL help link that further explains the exception. Esegue l'override di Exception. . :: . .HelpLink.
Proprietà protetta HResult Ereditato da Exception.
Proprietà pubblica InnerException Ereditato da Exception.
Proprietà pubblica Message Ereditato da Exception.
Proprietà protettaMembro statico ProdVer Gets the product version.
Proprietà pubblica Source Ereditato da Exception.
Proprietà pubblica StackTrace Ereditato da Exception.
Proprietà pubblica TargetSite Ereditato da Exception.

In alto

Metodi

  Nome Descrizione
Metodo pubblico Equals Ereditato da Object.
Metodo protetto Finalize Ereditato da Object.
Metodo pubblico GetBaseException Ereditato da Exception.
Metodo pubblico GetHashCode Ereditato da Object.
Metodo pubblico GetObjectData Ereditato da Exception.
Metodo pubblico GetType Ereditato da Exception.
Metodo protetto Init Initializes provider properties.
Metodo protetto MemberwiseClone Ereditato da Object.
Metodo protetto SetHelpContext Sets the help context for the help link.
Metodo pubblico ToString Ereditato da Exception.

In alto

Osservazioni

Using the DacException class, you can:

Thread Safety

Tutti i membri statici pubblici (Shared in Microsoft Visual Basic) di questo tipo sono sicuri per le operazioni a thread multipli. Non è invece garantita la sicurezza dei membri dell'istanza.

Esempi

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

Protezione dei thread

I membri static (Shared in Visual Basic) pubblici di questo tipo sono affidabili. Non è invece garantita la sicurezza dei membri dell'istanza.