Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed a purchase order form for which i have to save/edit/delete data from single form.

i have developed this form by databindings and wizard.

no how to save the first record which saves first the master record and then save the child record, as both have relation

the child table have column FK which refers to the master table Identity column.

I cant save the details.

Thanks,
Posted

First u need to insert the parent table recodes. Then u get the primary key of inserted record and then insert the child table records with the parent table primary key(FK).
 
Share this answer
 
Hi,
As Toniyo said, you may either do this in separate Store procedures or try to define relationship between these two table (with in the Data adapter created by the Wizard)

More about Relations ...
 
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