Certified ASP.NET Programmer Learning Resources Adding a database to the project

Learning Resources
 

Adding a database to the project


To create a database

  1. In Visual Web Developer, open Solution Explorer, right-click the App_Data folder of your Web application, and then click Add New Item.

    --or--

    If your application does not have an App_Data folder, right-click the root folder of your Web application, click Add ASP.NET Folder, and then click App_Data.

  2. Click SQL Database, type a name for the .mdf database file, and then click Add.

    Two files are created: DataBaseName.mdf and DataBaseName_log.ldf. Visual Web Developer automatically moves focus to the Data Connections section of the Server Explorer window and selects the newly created database.

To add a new database to the project

  1. From the Project menu, choose Add New Item.

  2. Select SQL Database from the list of available templates.

  3. Type SampleDatabase in the Name area.

  4. Click Add.

    The Data Source Configuration Wizard opens, but no database objects are available because this is a new database.

  5. Click Finish to create the database and dataset and add them to the project.

 

 For Support