EntityConnectionStringBuilder.Item[String] 屬性

定義

取得或設定與指定之索引鍵相關聯的值。 在 C# 中,這個屬性是索引子 (Indexer)。

public:
 virtual property System::Object ^ default[System::String ^] { System::Object ^ get(System::String ^ keyword); void set(System::String ^ keyword, System::Object ^ value); };
public override object this[string keyword] { get; set; }
member this.Item(string) : obj with get, set
Default Public Overrides Property Item(keyword As String) As Object

參數

keyword
String

要取得或設定之項目的索引鍵。

屬性值

與指定之索引鍵關聯的值。

例外狀況

keyword 為 null 參考 (在 Visual Basic 中為 Nothing)。

嘗試加入不存在於可用索引鍵中的索引鍵。

連接字串中的無效值 (特別當必須是布林值或數值,但未提供這些值時)。

備註

因為 EntityConnectionStringBuilder 包含固定大小的字典,所以嘗試加入不存在於字典中的索引鍵會擲回 KeyNotFoundException

如需有效關鍵字/值的語法,請參閱 ConnectionString

適用於

另請參閱