ASP.NET includes a profile provider that stores data using Microsoft SQL Server. The default ASP.NET machine configuration contains a default SqlProfileProvider instance named AspNetSqlProfileProvider that connects to SQL Server on the local machine. By default, the ASP.NET profile feature uses this instance of the provider. Alternatively, you can specify a different default provider in your application's Web.config file.
To use a SqlProfileProvider, you must first create the SQL Server database used by the SqlProfileProvider. You can create the database by running the Aspnet_regsql.exe command, which is found in the following path:
systemroot\Microsoft .NET\SDK\version
When you run the tool, you specify the -Ap option. The following command shows the syntax that you use to create the database required to store ASP.NET profiles using the SqlProfileProvider:
The example above does not specify a name for the database that is created, so the default name will be used. The default database name is Aspnetdb.
If the profile provider is configured with a connection string that uses integrated security, the process account of the ASP.NET application must have rights to connect to the SQL Server database.
Note: |
|---|
If you are using a SQL Server 2005 Express Edition database that is installed using the default configuration and the database is on the same computer as the Web server, the profile database will be created automatically by ASP.NET.
|