VWD Database Explorer
Creating a New Database
It is rare that you will use VWD to create a database from scratch. Good databases require the kind of planning and implementation tools that come with your database management system. However, in the case of a small and simple database, VWD does offer the necessary planning and implementation tools. You can add a new database in two ways: directly in the Database Explorer or by adding a SQL Database through the Add New Item menu in Solution Explorer.
Follow these steps to create a database in Database Explorer:
1.In the Database Explorer, right-click Data Connections and select Create New SQL Server Database.
2.Select a server. If you’re using SQL Server Express, use this exact syntax for the server name: (local)\SQLExpress. Use Windows authentication unless you have created an authentication scheme internal to SQL Server Express. Type the name of the new database into the bottom text box.
Database Explorer will automatically add the database to its list and you are ready to create tables and add data.
You can also create a new database directly in the Solution Explorer. This technique is very similar to the preceding procedure except for the first few steps:
1.Start in the Solution Explorer and right-click the root of the web site. Select Add New Item and select the template of type SQL Database.
2.When prompted, agree to add to the App_Data folder.
VWD will now roll you over to the Database Explorer where you will see the new database and folders for its objects (albeit empty). You can now create tables, add data, and perform other tasks.
Creating a New Table and Adding Data
Tables can be added and populated in the Database Explorer, as follows:
1.Expand the database, right-click the Tables node, and select Add New Table from the menu shown in Figure D-17.
Figure D-17