SqlCeConnection.State Property
Gets the current state of the connection.
Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)
Syntax
'Declaration
Public Overrides ReadOnly Property State As ConnectionState
Get
'Usage
Dim instance As SqlCeConnection
Dim value As ConnectionState
value = instance.State
public override ConnectionState State { get; }
public:
virtual property ConnectionState State {
ConnectionState get () override;
}
abstract State : ConnectionState
override State : ConnectionState
override function get State () : ConnectionState
Property Value
Type: System.Data.ConnectionState
A bitwise combination of the ConnectionState values. The default is Closed.
Implements
Remarks
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.
Note
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.