Question insert data into two tables

nzhmz

New member
Joined
Jun 29, 2010
Messages
4
Programming Experience
Beginner
i have a table which stores customer details (customer id is primary key and its auto incrementing). one customer can have many hobbies. so i took it as a separate table (customer ID as the foreign key of that table). when user enter data, i use single form to enter the customer details and their hobbies. so when i insert the record into two tables, will the second table(where i save the hobbies)will it take the new customer ID automatically into dat tables customer ID which is a foreign key.:confused::confused::confused::confused:

My Database is - Sql Server 2005
Using VB.Net to develop the application.

please help me. thank you in advance.
 
Read the DW2 links in my signature:
First read Creating a Simple Data App
Then read Displaying Related Data on a Form

Note that the app you build in the first step I think also introduces the master/detail concept
 
Back
Top