How to add a database to the project?

>> Aug 17, 2008

Assuming that the SQL Server 2005 or a newer version is installed.

To add a SQL Server Express database to the Web project, follow these steps:

1. In Solution Explorer, right-click the App_Data folder, and then click Add New Item.

2. In the Add New Item window, select SQL Database.

3. Change the name of the database to XXXXX.mdf and then click Add.

Visual Studio will warn you that you should place a database in a special App_Data folder. ASP.NET provides appropriate security permissions for the App_Data folder.

4. Click Yes to place the database in the App_Data folder.

Now, you will have an empty database.

Post a Comment

About This Blog

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP