EntityDataSource.ConnectionString 屬性

定義

取得或設定用來執行查詢的連接字串。

public:
 property System::String ^ ConnectionString { System::String ^ get(); void set(System::String ^ value); };
public string ConnectionString { get; set; }
member this.ConnectionString : string with get, set
Public Property ConnectionString As String

屬性值

用於查詢的連接字串。

備註

控制項 ConnectionStringEntityDataSource 屬性可以從儲存在應用程式組態檔 connectionStrings 元素中的具名 EDM 連接字串初始化。 使用實體資料模型精靈建立 EDM 時,會在應用程式組態檔中建立具名的 EDM 連線。 在應用程式組態檔中找到具名的 EDM 連接字串時,連線會顯示為 EntityDataSource 設計工具之 [設定資料來源精靈] 中的選項。 如需詳細資訊,請參閱 設定資料來源精靈 (EntityDataSource Control)

ContextTypeName如果未指定 屬性, DefaultContainerName 則必須設定 和 ConnectionString 屬性,控制項才能建立 ObjectContext

適用於