NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Hashtable.Add

Adds an entry with the specified key and value into the Hashtable.

[Visual Basic]
Overridable Public Sub Add( _
   ByVal key As Object, _
   ByVal value As Object _
)
[C#]
public virtual void Add(
   object key,
   object value
);
[C++]
public: virtual void Add(
   Object* key,
   Object* value
);
[JScript]
public function Add(
   key : Object,
   value : Object
);

Parameters

key
The key of the entry to add.
value
The value of the entry to add.

Return Value

None.

Exceptions

Exception Type Condition
ArgumentNullException key is a null reference (in Visual Basic Nothing).
ArgumentException An entry with the same key already exists in the Hashtable.
NotSupportedException The Hashtable is read-only.

Remarks

This method overrides the Add method of the Dictionary class and can itself be overridden by a derived class.

An object that has no correlation between its state and its hash code value should typically not be used as the key. For example, String objects are better than StringBuilder objects for use as keys.

See Also

Hashtable Class | Hashtable Members | System.Collections Namespace | Remove | Add