共用方式為


EntityConnection.State 屬性

[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]

取得 EntityConnection 的狀態,其設定目的是要為了追蹤由此 EntityConnection 包裝之基礎資料庫連接的狀態。

命名空間:  System.Data.Entity.Core.EntityClient
組件:  EntityFramework (在 EntityFramework.dll 中)

語法

'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")> _
Public Overrides ReadOnly Property State As ConnectionState 
    Get
'用途
Dim instance As EntityConnection 
Dim value As ConnectionState 

value = instance.State
[SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
public override ConnectionState State { get; }
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
public:
virtual property ConnectionState State {
    ConnectionState get () override;
}
[<SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")>]
abstract State : ConnectionState
[<SuppressMessageAttribute("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")>]
override State : ConnectionState
override function get State () : ConnectionState

屬性值

類型:System.Data.ConnectionState

Implements

IDbConnection.State

請參閱

參考

EntityConnection 類別

System.Data.Entity.Core.EntityClient 命名空間