ASP.NET 2.0 Security: Applying Membership and Roles database scripts to an existing database
ASP.NET 2.0 has beautiful inbuilt feature called Membership and Roles. With this you can create Member Registration / Login functionality with very minimal effort. One way to achieve this is through Visual Studio 2005 -> ASP.NET Configuration which will automatically create Membership database in the background. You might be wondering how use your existing database for the same purpose. Here is the set-by-step process to apply scripts on your existing database:
Open command prompt and navigate to .NET Framework 2.0 install folder (eg. “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\”)
Type “aspnet_regsql.exe” and hit enter to run the program
Open command prompt and navigate to .NET Framework 2.0 install folder (eg. “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\”)
Type “aspnet_regsql.exe” and hit enter to run the program
You will get following screen and click NEXT to continue
Select “Configure SQL Server for application services” (selected by default) and click NEXT
Enter your SQL Server Name / IP / (localhost), select authentication, database and click NEXT
Review details to make sure you are applying scripts on intended database and Click NEXT
Now your Database is ready to use for ASP.NET Membership and Roles
Finally you can modify your web.config file as follows:
0 Comments:
Post a Comment
<< Home