ApplicationName Property
Collapse the table of content
Expand the table of content

SqlProfileProvider.ApplicationName Property

Gets or sets the name of the application for which to store and retrieve profile information.

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

public override string ApplicationName { get; set; }

Property Value

Type: System.String
The name of the application for which to store and retrieve profile information. The default is the ApplicationVirtualPath value.


An attempt was made to set the ApplicationName property by a caller that does not have High ASP.NET hosting permission.


An attempt was made to set the ApplicationName property to a string that is longer than 256 characters.

The ApplicationName property is used by the SqlProfileProvider to associate profile information with different applications. This enables multiple applications to use the same database to store user information without running into conflicts between duplicate users. Multiple ASP.NET applications can use the same user database by specifying the same value in the ApplicationName property. The ApplicationName property can be set programmatically, or it can be set declaratively in the configuration file for the Web application using the applicationName attribute.

If a value is not specified for the applicationName attribute in the configuration file for the Web application, then the ApplicationVirtualPath value is used for ASP.NET applications. For non-ASP.NET applications, the default value is the ModuleName value without the file extension.

Caution noteCaution

Because a single default profile provider instance is used for all of the requests served by an HttpApplication object, you can have multiple requests executing concurrently and attempting to set the ApplicationName property value. The ApplicationName property is not thread safe for multiple writes, and changing the ApplicationName property value can result in unexpected behavior for multiple users of an application. It is recommended that you avoid writing code that allows users to set the ApplicationName property unless you must. An example of an application where setting the ApplicationName property may be required is an administrative application that manages profile data for multiple applications. Such an application should be a single-user application and not a Web application.

The following code example shows the profile element in the system.web section of the Web.config file for an ASP.NET application. It specifies the application's SqlProfileProvider instance and sets the ApplicationName property value to MyApplication.

<profile defaultProvider="SqlProvider">
    <add name="SqlProvider"
      applicationName="MyApplication" />

.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

© 2016 Microsoft