Initializes the provider.
Namespace:
System.Configuration.Provider
Assembly:
System.Configuration (in System.Configuration.dll)
Visual Basic (Declaration)
Public Overridable Sub Initialize ( _
name As String, _
config As NameValueCollection _
)
Dim instance As ProviderBase
Dim name As String
Dim config As NameValueCollection
instance.Initialize(name, config)
public virtual void Initialize(
string name,
NameValueCollection config
)
public:
virtual void Initialize(
String^ name,
NameValueCollection^ config
)
public function Initialize(
name : String,
config : NameValueCollection
)
| Exception | Condition |
|---|
| ArgumentNullException | The name of the provider is nullNothingnullptra 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 Profile Provider Implementation Example.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0, 2.0
Reference
Other Resources