Creating the Membership Database

Creating the Membership Database

To create a membership database for an ASP.NET application, you can use the ASP.NET Web Site Administration Tool or run SQL scripts that create the necessary database schema.

Here are the steps to create the membership database using the Web Site Administration Tool:

Open Visual Studio and create a new ASP.NET Web application.

In Solution Explorer, right-click the project and select “Add ASP.NET Folder” -> “App_Data”.

In the App_Data folder, right-click and select “Add New Item”.

Select “SQL Server Database” and enter a name for the database (e.g., “MembershipDB.mdf”). Click “Add”.

In Server Explorer, select the new database and choose “New Query”.

Execute the following SQL script to create the necessary schema:

css

Copy code

aspnet_regsql.exe -E -S localhost\SQLEXPRESS -d MembershipDB -A all

This will create the necessary tables and stored procedures for the membership system in the MembershipDB database.

Alternatively, you can manually create the schema by executing the appropriate SQL scripts. The scripts are typically located in the “C:\Windows\Microsoft.NET\Framework\v4.0.30319” folder. The scripts are named “InstallCommon.sql”, “InstallMembership.sql”, “InstallProfile.sql”, and “InstallRoles.sql”.

Once the membership database has been created, you need to configure the ASP.NET application to use it. This involves updating the web.config file with the connection string to the database and setting the appropriate membership provider settings.

This Web application uses a SQL Server Express database to store user information. The Fabrikam site recognizes three categories of users:

  • Anonymous visitors: These users don’t need to log in and are not included in the Membership database. They can visit most pages except the catalog and the people pages.
  • Members: Users who register for access.
  • Administrators: These are superusers who can add and remove members and generally manage the site. In addition to being registered users, they belong to the Administrators role.

Apply for ASP.NET Certification Now!!

https://www.vskills.in/certification/certified-aspnet-programmer

Back to Tutorial

Share this post
[social_warfare]
Planning and Scheduling Glossary
Configuring Forms Authentication

Get industry recognized certification – Contact us

keyboard_arrow_up