DataException Constructor (String, Exception)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Initializes a new instance of the DataException class with the specified string and inner exception.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

public DataException(
	string s,
	Exception innerException
)

Parameters

s
Type: System.String

The string to display when the exception is thrown.

innerException
Type: System.Exception

A reference to an inner exception.

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.

.NET Framework
Available since 1.1
Windows Phone Silverlight
Available since 7.1
Return to top
Show: