188Microsoft Visual Studio 2010: A Beginner’s Guide
can have zero or more orders. A foreign key can help manage the relationship between Customer and Order.
The mechanics of creating a foreign key relationship is that you put the foreign key column in the child table, Order, and have the foreign key column refer to the primary key of the parent table, Customer. In this case, the reference is made simply by matching the integer value; if the ID number is the same in both tables, then the records are related. As shown in Figure
To create this foreign key relationship in VS,
Next, click Add, select the Tables And Columns Specific property, and click the ellipses button that appears on the far right of your selection (the ellipses does not appear until you first click “Tables And Columns Specific” below “(General)” in the Foreign Key Relationships dialog window. This will open the Tables And Columns window shown in Figure