Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
ProviderBase Class
 Initialize Method
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
ProviderBase..::.Initialize Method

Updated: November 2007

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 _
)
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
)
J#
public 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.

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.

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 Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, 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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker