Chapter 7: Working with Data

191

Figure 7-9 A database diagram

the symbols—the key and the infinity symbol at the end of the line connecting the two tables—is what is important).

As shown in Figure 7-9, the database diagram shows you tables, columns, and relationships. You can use this window to add new tables and relationships. When you want to create a new table, right-click the design surface, select Add Table, and use the Visual Designer to configure the table, as in previous examples. What is helpful with this designer is the ease in which foreign key relationships can be created as compared to the method we used earlier to accomplish the same thing. To create a foreign key relationship, click the foreign key column in the child table, drag the carat to the parent table, and drop the carat on the primary key of the parent table. When you’re finished with creating the database diagram, VS will prompt for the diagram name; you can reply with a name of your choice and click OK to save the diagram.

Other features of the database diagram include navigation, printing, and multiple diagrams. When you have a database diagram larger than the screen size, click the symbol with the four arrow heads at the lower right-hand corner of the database diagram, and move your mouse to quickly navigate through the document. If you want a permanent

Page 214
Image 214
Microsoft 9GD00001 manual 191, A database diagram