Item Property
See Also 
SourceCode Namespace > ConnectionStringBuilderBase Class : Item Property



keyword
The key of the item to get or set.

Glossary Item Box

Gets or sets the value associated with the specified key.

Syntax

Visual Basic (Declaration) 
Public Overrides Default Property Item( _
   ByVal keyword As String _
) As Object
Visual Basic (Usage)Copy Code
Dim instance As ConnectionStringBuilderBase
Dim keyword As String
Dim value As Object
 
instance.Item(keyword) = value
 
value = instance.Item(keyword)
C# 
public override object this[ 
   string keyword
]; {get; set;}
C++/CLI 
public:
property Object^ default [String^] override {
   Object^ get(String^ keyword) override;
   void set (String^ keyword, Object^ value) override;
}

Parameters

keyword
The key of the item to get or set.

Property Value

The value associated with the specified key. If the specified key is not found, trying to get it returns a null reference (Nothing in Visual Basic), and trying to set it creates a new element using the specified key.Passing a null (Nothing in Visual Basic) key throws an System.ArgumentNullException. Assigning a null value removes the key/value pair.

Exceptions

ExceptionDescription
System.ArgumentNullExceptionkeyword is a null reference (Nothing in Visual Basic).
System.NotSupportedExceptionThe property is set, and the System.Data.Common.DbConnectionStringBuilder is read-only. -or-The property is set, keyword does not exist in the collection, and the System.Data.Common.DbConnectionStringBuilder has a fixed size.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also