Version

DataProviderErrorEventArgs Constructor

Creates a DataProviderErrorEventArgs instance in response to an exception being thrown within the data provider.
Syntax
'Declaration
 
Public Function New( _
   ByVal e As Exception, _
   ByVal dc As DataContext, _
   ByVal ec As ErrorCondition _
)
public DataProviderErrorEventArgs( 
   Exception e,
   DataContext dc,
   ErrorCondition ec
)

Parameters

e
An Exception instance caught from the .NET Framework while executing data provider operations.
dc
The DataContext of the operation being performed when the error occured.
ec
An enumeration value indicating the type of data provider error that has occured.
Remarks

Developers do not ordinarily need to create their own instance of an DataProviderErrorEventArgs themselves, as the data provider implementation will catch an Exception and do it for you. However, those who extend the built-in data providers to add functionality or support alternative DBMSes may catch their own Exception and propagate it through the firing of the DataProviderError event. When this is the case, the implementor of a custom data provider would wrap the Exception within a DataProviderErrorEventArgs and fire the event.

Specifying an Exception or a DataContext is optional. Developers should make every effort to specify the DataContext from a custom data provider when the ErrorCondition value is either ConcurrencyConflict or DataError in order to provide event subscribers with additional information about the operation that had caused the error to be raised.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also