How to configure the ASP.NET 2.0 Membership/Roles Provider to use SQL 2000 or SQL 2005?
The information in this article applies to:
ASP.NET 2.0 MS SQL 2000 MS SQL 2005 Membership/Roles Provider SUMMARY
How to set up the new ASP.NET 2.0 Membership, Role Management, and Personalization services to use a regular hosted SQL Server 2005 or SQL 2000 instead of MicroSoft SQL Server Express.
DETAILS
The following steps create the full Application Services database schema on our SQL Server database.
- Open the command prompt on your local computer, and navigate to:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 - Execute the command:
aspnet_regsql.exe -S [DB Server Name] -U [DB login] -P [Password] -A all -d [Database name]
Below is an example of how to configure Visual Web Developer to manage the membership database.
- Create a web application in Visual Web Developer or Visual Studio 2005.
- Open the web.config.
- The default membership provider uses a connection string called "LocalSqlServer".
Replace:
<connectionStrings/>
with
<connectionStrings><remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=<DB_Server>;Integrated Security=false;Initial
Catalog=<DB_Name>;User ID=<DB_User>;Password=<DB_password>" providerName="System.Data.SqlClient" />
</connectionStrings>
Save and close the web.config.
- Go to Website menu, and run the ASP.NET Configuration tool. This will open the Web Site Administration tool in a browser window.
- Next.. In the Web Site Administration browser, go to the Security tab.
- Click on "Select authentication type".
- Select "From the internet". Then click the "Done" button.
- Create your admin roles and users.
- Then create access rules.
- Create a rule that applies to the "Anonymous users" with "Deny" permissions.
- Create another rule that applies to the admin role you created with "Allow" permissions.
- Your application is now ready to use the membership provider.
Copied for ease of access. Credit given to: http://support.re-invent.com/article.aspx?id=10353