Export (0) Print
Expand All

OdbcConnection.State Property

Gets the current state of the connection.

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

[<BrowsableAttribute(false)>]
abstract State : ConnectionState with get
[<BrowsableAttribute(false)>]
override State : ConnectionState with get

Property Value

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

Implements

IDbConnection.State

The following are allowed state changes:

  • From Closed to Open, using the Open method.

  • From Open to Closed, using either the Close or Dispose method.

NoteNote

Calling the State property on an open connection increases application overhead because each such call causes a SQL_ATTR_CONNECTION_DEAD call to the underlying ODBC driver to determine whether the connection is still valid.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft