This documentation is archived and is not being maintained.

ProviderBase.Initialize Method

Initializes the provider.

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

public virtual void Initialize (
	string name,
	NameValueCollection config
)
public void Initialize (
	String name, 
	NameValueCollection config
)
public function Initialize (
	name : String, 
	config : NameValueCollection
)
Not applicable.

Parameters

name

The friendly name of the provider.

config

A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.

Exception typeCondition

ArgumentNullException

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

ArgumentException

The name of the provider has a length of zero.

InvalidOperationException

An attempt is made to call Initialize on a provider after the provider has already been initialized.

The base class implementation internally tracks the number of times the provider's Initialize method has been called. If a provider is initialized more than once, an InvalidOperationException is thrown stating that the provider is already initialized.

Because most feature providers call Initialize prior to performing provider-specific initialization, this method is a central location for preventing double initialization.

For an example of how to use Initialize, see How To: Sample Profile Provider Implementation.

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
Show: