ProviderCollection.Add Method

Adds a provider to the collection.

Namespace: System.Configuration.Provider
Assembly: System.Configuration (in system.configuration.dll)

public:
virtual void Add (
	ProviderBase^ provider
)
public void Add (
	ProviderBase provider
)
public function Add (
	provider : ProviderBase
)
Not applicable.

Parameters

provider

The provider to be added.

Exception typeCondition

NotSupportedException

The collection is read-only.

ArgumentNullException

provider is a null reference (Nothing in Visual Basic).

ArgumentException

The Name of provider is a null reference (Nothing in Visual Basic).

- or -

The length of the Name of provider is less than 1.

The Add method first checks for any exceptions (as listed in the Exceptions section), and then calls the Hashtable.Add method. It passes in the object referenced by the provider parameter as well as the Name property of the provider to be used as the key in the Hashtable object.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: