.NET Framework Class Library
ProviderBase..::.Initialize Method

Initializes the provider.

Namespace:  System.Configuration.Provider
Assembly:  System.Configuration (in System.Configuration.dll)
Syntax

Visual Basic (Declaration)
Public Overridable Sub Initialize ( _
    name As String, _
    config As NameValueCollection _
)
Visual Basic (Usage)
Dim instance As ProviderBase
Dim name As String
Dim config As NameValueCollection

instance.Initialize(name, config)
C#
public virtual void Initialize(
    string name,
    NameValueCollection config
)
Visual C++
public:
virtual void Initialize(
    String^ name, 
    NameValueCollection^ config
)
JScript
public function Initialize(
    name : String, 
    config : NameValueCollection
)

Parameters

name
Type: System..::.String
The friendly name of the provider.
config
Type: System.Collections.Specialized..::.NameValueCollection
A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.
Exceptions

ExceptionCondition
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.

Remarks

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.

Examples

For an example of how to use Initialize, see Profile Provider Implementation Example.

Platforms

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.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0
See Also

Reference

Other Resources

Tags :


Page view tracker