SettingsProviderCollection.Add Method

Adds a new settings provider to the collection.

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

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

Parameters

provider

A ProviderBase to add to the collection.

Exception typeCondition

ArgumentException

The provider parameter is not of type SettingsProvider.

-or-

The Name property of the provider parameter is null or an empty string.

-or-

A settings provider with the same Name already exists in the collection.

NotSupportedException

The collection is read-only.

ArgumentNullException

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

The Name property of the SettingsProvider is used as the storage key.

Caution noteCaution:

Although the Add method has a single ProviderBase parameter to match the signature of this same method in the base class ProviderCollection, this method will throw an exception if the provider parameter is not of type SettingsProvider.

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: