SqlCeConnection.State 屬性
取得連接的目前狀態。
命名空間: System.Data.SqlServerCe
組件: System.Data.SqlServerCe (在 System.Data.SqlServerCe.dll 中)
語法
'宣告
Public Overrides ReadOnly Property State As ConnectionState
Get
'用途
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
屬性值
型別:System.Data.ConnectionState
ConnectionState 值的位元組合。預設值為 Closed。
實作
備註
允許的狀態變更為:
注意
因為每次呼叫都會導致呼叫開啟連接的 OLE DB DBPROP_CONNECTIONSTATUS 屬性,所以呼叫 State 屬性會增加應用程式的負擔。