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 system.data.sqlserverce.dll)

Syntax

'Declaration
<ObsoleteAttribute("This property is obsolete and will be removed in a future version.")> _
Public Event StateChange As StateChangeEventHandler
[ObsoleteAttribute("This property is obsolete and will be removed in a future version.")] 
public override event StateChangeEventHandler StateChange
[ObsoleteAttribute(L"This property is obsolete and will be removed in a future version.")] 
public:
virtual event StateChangeEventHandler^ StateChange {
    void add (StateChangeEventHandler^ value) override;
    void remove (StateChangeEventHandler^ value) override;
}
/** @event */
public void add_StateChange (StateChangeEventHandler value)

/** @event */
public void remove_StateChange (StateChangeEventHandler value)
JScript supports the use of events, but not the declaration of new ones.

Remarks

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.

Platforms

Development Platforms

Windows Vista, Windows Mobile 5.0, Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Mobile 2003 for Pocket PC, Windows CE 5.0
Version Information
.NET Framework and NET Compact Framework
Supported in 3.5
.NET Framework
Supported in 3.0
.NET Compact Framework and .Net Framework
Supported in 2.0

See Also

Reference

SqlCeConnection Class
SqlCeConnection Members
System.Data.SqlServerCe Namespace