OleDbConnection.State OleDbConnection.State OleDbConnection.State OleDbConnection.State Property

定义

获取连接的当前状态。Gets the current state of the connection.

public:
 property System::Data::ConnectionState State { System::Data::ConnectionState get(); };
[System.ComponentModel.Browsable(false)]
[System.Data.DataSysDescription("DbConnection_State")]
public System.Data.ConnectionState State { get; }
member this.State : System.Data.ConnectionState
Public ReadOnly Property State As ConnectionState

属性值

ConnectionState 值的按位组合。A bitwise combination of the ConnectionState values. 默认值为 Closed。The default is Closed.

实现

注解

允许的状态更改如下:The following are allowed state changes:

备注

在以前版本的 .NET Framework 中,调用State属性会增加应用程序开销,因为每个调用都会导致调用 open 连接的 OLE DB DBPROP_CONNECTIONSTATUS 属性。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. 随着 .NET Framework 2.0 的发布,这不再是问题。With the release of the .NET Framework 2.0, this is no longer an issue.

适用于

另请参阅