Custom Form-Based Authentication in ASP.NET
page 3 of 7
by Steven Swafford
Feedback
Average Rating: 
Views (Total / Last 10 Days): 34427/ 131

Prepare Your SQL Server Database

The first step you should take is to set up your database so that you can begin to work with the Membership API. This is a simple task thanks in large part to the GUI interface that ships with the .NET 2.0 framework. For those of you die-hard command-line junkies, there is no need to worry, just run aspnet_regsql.exe with the command line switch /?, and youre all set. For those who prefer the GUI interface, simply run aspnet_regsql.exe from a command prompt or the run window within Windows. By default this tools starts in wizard mode.

Figure 2: ASP.NET SQL Server Setup Wizard

Figure 3: Select a Setup Option

Figure 4: Select the Server and Database

Figure 5: Confirm Your Settings

As you can gather, this takes very little effort on our part, and to drive home the point, here is a screenshot of a database after I ran this wizard.

Figure 6: Example Database Schema

At this point, your database has been prepared, and you are now ready to move on to the Visual Studio .NET 2005 IDE and create a registration page without writing a single line of code. One point I need to make is that you need to modify your web.config to point to the database that you have just provisioned.

Listing 1: Example SQL Server Connection String

<remove name="LocalSqlServer" />

<add name="LocalSqlServer"

  providerName="System.Data.SqlClient"

  connectionString="server=servername;uid=userid;pwd=password;database=databasename"/>


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-09-17 12:37:20 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search