SqlCeConnection.StateChange Event

Occurs when the state of the connection changes.

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

public override event StateChangeEventHandler StateChange

The StateChange event fires whenever the State changes from closed to opened, or from opened to closed. StateChange fires immediately after the SqlCeConnection transitions.

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

The StateChange event is not raised unless you explicitly call Close or Dispose.

Show: