EntityConnectionStringBuilder.Item[String] 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定與指定鍵相關聯的值。 在 C# 中,這個屬性就是索引器。
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
要取得或設定的物品鑰匙。
屬性值
與指定鍵相關聯的值。
例外狀況
我試著新增一個在可用金鑰中不存在的金鑰。
連接字串 中的無效值(具體來說,預期會輸入布林值或數字值,但未提供)。
備註
由於 包含 EntityConnectionStringBuilder 固定大小的字典,嘗試加入字典中不存在的鍵值會拋出一個 KeyNotFoundException。
關於有效的關鍵字/值語法,請參見 ConnectionString。