Using Database Projects and Web Projects Together

Database projects and Web projects appear in separate nodes in a solution because they are different types of projects. Use Web projects to create dynamic Web pages and display information (including data from databases). Use database projects to create, manage, and deploy enterprise databases.

You can use a database project and a Web project together, however, if you want to maintain control over and deploy a database whose data you also want to display on a Web page. You can create a data connection in the Web project, then add this connection to the database project. The SQL scripts in the database project control the structure and data in the database.

To use a Web project data connection in a database project

  1. Create a Web project. For details, see Creating a Web Project.

  2. Add a data connection to the Web project. For details, see Connecting to a Database.

  3. Create a database project. For details, see Creating a Database Project.

  4. Add the data connection from the Web project to the database project.

  5. Create SQL scripts in the database project to manage the database and its objects. For details, see Creating SQL Scripts.

  6. If you want, deploy the database project to other solutions.

Note   You can't drag and drop database objects between Web projects and database projects.