adding data in relatonal tables in .net using c# visual studio 2010
I am having a set of 15 tables all of which are connected via some key to each other.
lets take 3 tables as example
table 1
id
f1
f2
table 2
id
table1_id
f3
f4
table 3
id
table2_id
f5
f6
where table1_id,table2_id are foreign keys.
Now I want to create a form with set of text boxes as : f1 f2 f3 f4 f5 f6.
is there 开发者_JS百科a simple association that I can make with the text boxes so that on the click of ok button f1 f2 goes to table 1 and then f3 f4 goes to table 2 along with the table1_id etc ?
Its a desktop app.
You don't specify which data access framework you use, but if you're willing to look at EF, it can map an entity to multiple tables, so you could model your form data as such.
Look at this:
http://msdn.microsoft.com/en-us/library/cc716698.aspx
Cheers
精彩评论