ProviderCollection.Add Method

Note: This method is new in the .NET Framework version 2.0.

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
)

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 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: