System.Data.Common.DbConnectionStringBuilder.Add Method

Adds an entry with the specified key and value into the System.Data.Common.DbConnectionStringBuilder.

Syntax

public void Add (string keyword, object value)

Parameters

keyword
The key to add to the System.Data.Common.DbConnectionStringBuilder.
value
The value for the specified key.

Remarks

The DbConnectionStringBuilder.Item(string) property can also be used to add new elements by setting the value of a key that does not exist in the dictionary. For example: myCollection["myNonexistentKey"] = myValue.

Calling the DbConnectionStringBuilder.Add(string, object) method by passing a null (Nothing in Visual Basic) key throws an ArgumentNullException. However, calling the DbConnectionStringBuilder.Add(string, object) method by passing a null value removes the key/value pair.

Requirements

Namespace: System.Data.Common
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0