DB2 10.5 for Linux, UNIX, and Windows

DB2Connection.StateChange Event

Occurs when the state of the connection changes.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax

[Visual Basic]
Public Event StateChange As StateChangeEventHandler
[C#]
public event StateChangeEventHandler StateChange;
[C++]
public: __event StateChangeEventHandler* StateChange;
[JScript] In JScript(R), you can handle the events defined by a class, but you cannot declare new events.
Table 1. Event Data
Item 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.

Remarks

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 methods.