Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 2 tables and I have taken a primary key for parent table and a foreign key for child table. Based on primary key table I am retrieving data from the child table.
In this case I want to add a new record, which is not stored in both tables. Can you tell me how it is done? Help me.
Posted
Updated 15-Dec-10 18:00pm
v4

1 solution

You would need to first populate the child table, get the unique key for the row inserted and then use that as foreign key while inserting in the parent table.

It's like the one which is dependant will be filled later.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900