dotConnect Universal Documentation
Devart.Data.Universal Namespace / UniConnection Class / StateChange Event

StateChange Event (UniConnection)
Occurs when the state of the connection changes.
Syntax
'Declaration
 
Public Event StateChange As StateChangeEventHandler
 
Event Data

The event handler receives an argument of type StateChangeEventArgs containing data related to this event. The following StateChangeEventArgs properties provide information specific to this event.

PropertyDescription
Gets the new state of the connection. The connection object will be in the new state already when the event is fired.  
Gets the original state of the connection.  
Remarks
The event handler receives an argument of type System.Data.StateChangeEventArgs containing data related to this event. The following System.Data.StateChangeEventArgs properties provide information specific to this event.
Property Description
CurrentState Gets the new state of the connection. The connection object will be in the new state already when the event is fired.
OriginalState Gets the original state of the connection.

The StateChange event is raised immediately after the State changes from Closed to Opened, or from Opened to Closed.

If an event handler throws an exception from within the StateChange event, the exception propagates to the caller of the Open or Close method.

Requirements

Target Platforms: 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