How to Create Aspnetdb

Updated on 17 Apr 2012,
Published on 19 May 2008

Introduction

Microsoft has introduced a new and powerful default database schema in ASP.Net 2.0 as ASPNETDB.mdf database. This database file serves as a role provider, membership provider and web parts personalization handling with the help of BLOBs. Visual Web Developer 2005 supports the ASP.Net configuration to manage this personal aspnetdb database file within the web application inside the App_Data folder. Aspnetdb database helps in managing users along with their roles e.g. admin, employee, editors etc. It also enables the in-built functionality of Login controls and web parts to be integrated on ASP.Net 2.0 web pages that helps in managing user profiles, login, and personalized user pages very easily even without writing the bulky code to implement the sql queries or stored procedures along with data access code for inserting, updating or deleting the user personalized data.

How to create Aspnetdb database?

Using aspnet_regsql command:
You can use aspnet_regsql command to create aspnetdb database. This command executes the default scripts to create the default database for asp.net 2.0 web applications.

Steps to create aspnetdb database using aspnet_regsql command:

1. Open the Visual Studio 2005 command prompt from Start --> All Programs --> Microsoft Visual Studio 2005 --> Visual Studio Tools --> Visual Studio 2005 Command Prompt

2. type aspnet_regsql and press enter key

3. This will open the ASP.Net SQL Server Setup wizard. Click next to continue...
 

4. In the next screen select the option to Configure SQL Server for application services. This option executes a script to configure the database for managing user profiles, roles, membership and personalization. Click next to continue…

5. In this step enter the sql server name and choose the right authentication method. Leave the database field to default and click next...

6. Confirm your settings and click next to finish.

Continue to next tutorial: Creating Attachdbfilename Datadirectory Aspnetdb.mdf to learn how to attach the local database file in ASP.Net application.

12 Responses to "How to Create Aspnetdb"
Rahul
thank you,,it was very helpful
fabio
hey, nice article. I have a very basic question, with this ASPNET db which manages users and profiles etc should application specific data like products, orders shipping info be stored in the same db which allows me to add foreign keys etc. Or should it be stored in a new db and relate the users to the products etc across databases. Thanks Fabio
Ezineasp.net
Hi Fabio Yes the default database Aspnetdb allows to add other tables to store your web application related data as you specified in ur question such as products, orders etc. You can create foreign keys also. Its upto you whether you are sharing single users database with multiple web applications or you are developing single web application having its own users database. Good Luck
fabio
thanks for the reply Fabio
Venkat
Hi i got the db, thanks nice info.
John
This is really very helpful for us. thnks
Francisco
But working with aspnet_regsql it creates all the tables automaticly and I feel submited and lost, because I want choose which data to keep in the table for every user, by that reason I am looking for custom autentication and I was looking for an table design example but manually not with prebuild tools.

Thanks
Sourav Kings
Last step is showing an error:- "Unable to connect SQL Server database." Please help
Akhtar jahan
Thanks. it works fine
rezaroshan From Iran
Very thanks. bye
Pradeep
Thanks It is really very helpful.
Great!,,,,Its working perfect...
Leave a Comment
* required
* required
* will not be published
* optional
* hint: http://www.example.com
  • Subscribe via Email
  • HIRE EzineASP.Net Developers