OdbcConnectionStringBuilder::Item Property (String^)
Gets or sets the value associated with the specified key. In C#, this property is the indexer.
Assembly: System.Data (in System.Data.dll)
public: property Object^ default[ String^ keyword ] { virtual Object^ get(String^ keyword) override; virtual void set(String^ keyword, Object^ value) override; }
Parameters
- keyword
-
Type:
System::String^
The key of the item to get or set.
| Exception | Condition |
|---|---|
| ArgumentException | The connection string is incorrectly formatted (perhaps missing the required "=" within a key/value pair). |
| ArgumentNullException | keyword is a null reference (Nothing in Visual Basic). |
When you set this property, if the specified key already exists in the dictionary, the value is replaced; otherwise, a new element is created.
The following code, in a console application, creates a new OdbcConnectionStringBuilder and adds key/value pairs to its connection string, using the Item property.
Available since 2.0