Export (0) Print
Expand All

SqlMembershipProvider.Initialize Method

Initializes the SQL Server membership provider with the property values specified in the ASP.NET application's configuration file. This method is not intended to be used directly from your code.

Namespace:  System.Web.Security
Assembly:  System.Web (in System.Web.dll)

public override void Initialize(
	string name,
	NameValueCollection config
)

Parameters

name
Type: System.String
The name of the SqlMembershipProvider instance to initialize.
config
Type: System.Collections.Specialized.NameValueCollection
A NameValueCollection that contains the names and values of configuration options for the membership provider.

ExceptionCondition
System.ArgumentNullException

config is null.

System.Configuration.Provider.ProviderException

The enablePasswordRetrieval, enablePasswordReset, requiresQuestionAndAnswer, or requiresUniqueEmail attribute is set to a value other than a Boolean.

- or -

The maxInvalidPasswordAttempts or the passwordAttemptWindow attribute is set to a value other than a positive integer.

- or -

The minRequiredPasswordLength attribute is set to a value other than a positive integer, or the value is greater than 128.

- or -

The minRequiredNonalphanumericCharacters attribute is set to a value other than zero or a positive integer, or the value is greater than 128.

- or -

The value for the passwordStrengthRegularExpression attribute is not a valid regular expression.

- or -

The applicationName attribute is set to a value that is greater than 256 characters.

- or -

The passwordFormat attribute specified in the application configuration file is an invalid MembershipPasswordFormat enumeration.

- or -

The passwordFormat attribute is set to Hashed and the enablePasswordRetrieval attribute is set to true in the application configuration.

- or -

The passwordFormat attribute is set to Encrypted and the machineKey configuration element specifies AutoGenerate for the decryptionKey attribute.

- or -

The connectionStringName attribute is empty or does not exist in the application configuration.

- or -

The value of the connection string for the connectionStringName attribute value is empty, or the specified connectionStringName does not exist in the application configuration file.

- or -

The value for the commandTimeout attribute is set to a value other than zero or a positive integer.

- or -

The application configuration file for this SqlMembershipProvider instance contains an unrecognized attribute.

HttpException

The current trust level is less than Low.

InvalidOperationException

The provider has already been initialized prior to the current call to the Initialize method.

This method initializes the SqlMembershipProvider with the property values specified in the ASP.NET application configuration file (Web.config) and is not intended to be used directly from your code.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft