DataException Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the DataException class.
Overloads
DataException() |
Initializes a new instance of the DataException class. This is the parameterless constructor. |
DataException(String) |
Initializes a new instance of the DataException class with the specified string. |
DataException(SerializationInfo, StreamingContext) |
Obsolete.
Initializes a new instance of the DataException class with the specified serialization information and context. |
DataException(String, Exception) |
Initializes a new instance of the DataException class with the specified string and inner exception. |
DataException()
- Source:
- DataException.cs
- Source:
- DataException.cs
- Source:
- DataException.cs
Initializes a new instance of the DataException class. This is the parameterless constructor.
public:
DataException();
public DataException ();
Public Sub New ()
Applies to
DataException(String)
- Source:
- DataException.cs
- Source:
- DataException.cs
- Source:
- DataException.cs
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)
Parameters
- s
- String
The string to display when the exception is thrown.
See also
Applies to
DataException(SerializationInfo, StreamingContext)
- Source:
- DataException.cs
- Source:
- DataException.cs
- Source:
- DataException.cs
Caution
This API supports obsolete formatter-based serialization. It should not be called or extended by application code.
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);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
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
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Data.DataException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Data.DataException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
Parameters
- info
- SerializationInfo
The data necessary to serialize or deserialize an object.
- context
- StreamingContext
Description of the source and destination of the specified serialized stream.
- Attributes
Applies to
DataException(String, Exception)
- Source:
- DataException.cs
- Source:
- DataException.cs
- Source:
- DataException.cs
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)
Parameters
- s
- String
The string to display when the exception is thrown.
- innerException
- Exception
A reference to an inner exception.
Remarks
You can create a new exception that catches an earlier exception. 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.