This is an example for defining a foreign key relationship in Microsoft SQL Server (SQLEXPRESS). There are two tables: Salesperson and Customer (see below). After the SalepersonID column is created in the Customer, it is important to define a foreign key relationship to ensure the referential integrity.
A. The Salesperson table.

B. The Customer table.

C. Foreign Key Relationship
Step 1. Select the SalespersonID column of the Customer table.
Step 2. Select the menu Table Designer >> Relationships…, then the “Foreign Key Relationships” window is desplayed. Locate and click the “Tables And Columns Specification” property.

Step 3. Click the little button (
), then the “Tables and Columns” window is displayed. Make sure that the Foreign key table is Customer. So choose the SalespersonID column as the foreign key column. Then choose Salesperson as the Primary key table; and make its ID column as the primary key column.

Step 4. Click the OK button on the “Tables and Columns” window. Then, click the Close button on the “Foreign Key Relationships” window.
Here is the link: http://asp.dotnetheaven.com/howto/doc/adoplus/DatabaseTrans.aspx. It has examples in C#, VB, and C++.
Changing the startup Windows form (Visual Studio .Net)
March 1, 2007
Starting with SQLEXPRESS (Microsoft SQL Server)
February 19, 2007
It is suggested to manage SQLEXPRESS using SQL Server Management Studio Express, which is free from Microsoft.
1. Download SQL Server Management Studio Express. Go to:
http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&DisplayLang=en
2. After install it successfully, open the studio and log on your EQLEXPRESS server. Note that the server name must include EQLEXPRESS following your machine name and Windows Authentication should be used.
3. The Object Explorer is displayed after a successful login.
4. To create a database, right-click the Databases folder and select the New Database menu item.
5. To create a table, right-click the Tables folder and select the New Table menu item.



