SqlCeConnection.State Property

Gets the current state of the connection.

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

public override ConnectionState State { get; }

Property Value

Type: System.Data.ConnectionState
A bitwise combination of the ConnectionState values. The default is Closed.



The allowed state changes are:

  • From Closed to Open, by using the Open method of the connection object.

  • From Open to Closed, by using either the Close method or the Dispose method of the connection object.


Calling the State property increases application overhead because each call results in a call to the OLE DB DBPROP_CONNECTIONSTATUS property for an open connection.