DataException Construtores

Definição

Inicializa uma nova instância da classe DataException.Initializes a new instance of the DataException class.

Sobrecargas

DataException()

Inicializa uma nova instância da classe DataException.Initializes a new instance of the DataException class. Esse é o construtor sem parâmetros.This is the parameterless constructor.

DataException(String)

Inicializa uma nova instância da classe DataException com a cadeia de caracteres especificada.Initializes a new instance of the DataException class with the specified string.

DataException(SerializationInfo, StreamingContext)

Inicializa uma nova instância da classe DataException com o contexto e as informações de serialização especificados.Initializes a new instance of the DataException class with the specified serialization information and context.

DataException(String, Exception)

Inicializa uma nova instância da classe DataException com a cadeia de caracteres e a exceção interna especificadas.Initializes a new instance of the DataException class with the specified string and inner exception.

DataException()

Inicializa uma nova instância da classe DataException.Initializes a new instance of the DataException class. Esse é o construtor sem parâmetros.This is the parameterless constructor.

public:
 DataException();
public DataException ();
Public Sub New ()

Aplica-se a

DataException(String)

Inicializa uma nova instância da classe DataException com a cadeia de caracteres especificada.Initializes a new instance of the DataException class with the specified string.

public:
 DataException(System::String ^ s);
public DataException (string? s);
public DataException (string s);
new System.Data.DataException : string -> System.Data.DataException
Public Sub New (s As String)

Parâmetros

s
String

A cadeia de caracteres a ser exibida quando a exceção é gerada.The string to display when the exception is thrown.

Confira também

Aplica-se a

DataException(SerializationInfo, StreamingContext)

Inicializa uma nova instância da classe DataException com o contexto e as informações de serialização especificados.Initializes a new instance of the DataException class with the specified serialization information and context.

protected:
 DataException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected DataException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Data.DataException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Data.DataException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parâmetros

info
SerializationInfo

Os dados necessários para serializar ou desserializar um objeto.The data necessary to serialize or deserialize an object.

context
StreamingContext

Descrição da origem e do destino do fluxo serializado especificado.Description of the source and destination of the specified serialized stream.

Aplica-se a

DataException(String, Exception)

Inicializa uma nova instância da classe DataException com a cadeia de caracteres e a exceção interna especificadas.Initializes a new instance of the DataException class with the specified string and inner exception.

public:
 DataException(System::String ^ s, Exception ^ innerException);
public DataException (string? s, Exception? innerException);
public DataException (string s, Exception innerException);
new System.Data.DataException : string * Exception -> System.Data.DataException
Public Sub New (s As String, innerException As Exception)

Parâmetros

s
String

A cadeia de caracteres a ser exibida quando a exceção é gerada.The string to display when the exception is thrown.

innerException
Exception

Uma referência a uma exceção interna.A reference to an inner exception.

Comentários

Você pode criar uma nova exceção que captura uma exceção anterior.You can create a new exception that catches an earlier exception. O código que manipula a segunda exceção pode fazer uso das informações adicionais da exceção anterior, também chamada de exceção interna, para examinar a causa do erro inicial.The code that handles the second exception can make use of the additional information from the earlier exception, also called an inner exception, to examine the cause of the initial error.

Aplica-se a