StateChange Event
Collapse the table of content
Expand the table of content

SqlCeConnection.StateChange Event

NOTE: This event is now obsolete.

Occurs when the state of the connection changes.

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

[ObsoleteAttribute("This property is obsolete and will be removed in a future version.")] 
public override event StateChangeEventHandler StateChange
/** @event */
public void add_StateChange (StateChangeEventHandler value)

/** @event */
public void remove_StateChange (StateChangeEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

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.

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Obsolete (compiler warning) in 3.0

.NET Compact Framework

Supported in: 1.0
Obsolete (compiler warning) in 2.0

Community Additions

© 2016 Microsoft