Adds an entry with the specified key and value into the Dictionary.
[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 );
None.
Exception Type | Condition |
---|---|
ArgumentNullException | key is a null reference (in Visual Basic Nothing). |
ArgumentException | An entry with the same key already exists in the Dictionary. |
NotSupportedException | The Dictionary is read-only. |
This method can be overridden by a derived class.
Dictionary Class | Dictionary Members | System.Collections Namespace | Remove