OleDbConnection::State Property
Gets the current state of the connection.
Assembly: System.Data (in System.Data.dll)
public: [BrowsableAttribute(false)] property ConnectionState State { virtual ConnectionState get() override; }
Property Value
Type: System.Data::ConnectionStateA bitwise combination of the ConnectionState values. The default is Closed.
The following are allowed state changes:
From Closed to Open, using the Open method of the OleDbConnection object.
From Open to Closed, using either the Close method or the Dispose method of the OleDbConnection object.
Note |
|---|
In previous version of the .NET Framework, calling the State property increased application overhead because each call caused a call to the OLE DB DBPROP_CONNECTIONSTATUS property for an open connection. With the release of the .NET Framework 2.0, this is no longer an issue. |
Available since 1.1
