ProfileSection.DefaultProvider Property

 

Gets or sets the name of the default profile provider.

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

[ConfigurationPropertyAttribute("defaultProvider", DefaultValue = "AspNetSqlProfileProvider")]
[StringValidatorAttribute(MinLength = 1)]
public string DefaultProvider { get; set; }

Property Value

Type: System.String

The name of a provider in the Providers collection, or an empty string (""). The default is "AspNetSqlProfileProvider."

A profile provider points to a data source in which user profile values are stored. You can specify profile providers in the providers subsection of the profile section of a configuration file.

The following code example shows how to use the DefaultProvider property. This code example is part of a larger example provided for the ProfileSection class.


// Get the current DefaultProvider property value.
Console.WriteLine(
    "Current DefaultProvider value: '{0}'", profileSection.DefaultProvider);

// Set the DefaultProvider property to "AspNetSqlProvider".
profileSection.DefaultProvider = "AspNetSqlProvider";

.NET Framework
Available since 2.0
Return to top
Show: