共用方式為


EntityConnection.ConnectionString 屬性

定義

取得或設定 EntityConnection 連接字串。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
public override string ConnectionString { get; set; }
member this.ConnectionString : string with get, set
Public Overrides Property ConnectionString As String

屬性值

建立資料來源之初始連接所需的連接字串。 預設值為空字串。 在關閉的連接上會傳回目前設定的值。 如果沒有設定值,則傳回空字串。

屬性

例外狀況

嘗試在 初始化 之後 MetadataWorkspace 設定 ConnectionString 屬性 EntityConnection 。 當透過使用 MetadataWorkspace 當做參數的多載來建構 EntityConnection 執行個體或是已開啟 MetadataWorkspace 執行個體時,初始化 EntityConnection

已提供無效的連接字串關鍵字,或尚未提供必要的連接字串關鍵字。

適用於