Question about inserting data with child table

M

Mika M

Hello!

Yesterday I asked some basics about inserting data. Subject was 'Newbie
question about inserting data'. Anyway I need something more today :)

I wondering how should I do following...

Application has two forms: Form1 for inserting master table rows, and Form2
for inserting for example serial numbers for selected master table row in
DataGrid on Form1. When Form1 is loaded, it contains DataSet with Master and
Child table, but because these form are only for inserting data, I need
nothing but column names with no data rows in the beginning. When master
table in Form1 has any rows, I want to open Form2 to insert child records
into child table. When Form2 is opened using for example using 'Insert
Details' -button, I want to send reference of child table for the Form2, and
this table will be edited there (not in same form as master table), but I'm
not how to send this reference.

Finally I should save these tables content using 'Save'-button after
editing, so I need to ensure MasterID and ChildID will match in database
tables too. Obviously these key value fields in database must be Data Type
int, but I'm not sure should MasterID be 'Identity = Yes' or not in master
table too?

I think this is easy to do, but not yet for me. How to do this? Any examples
or www-link available?
 
C

Cor Ligthert

Hi Mike,

I did send you a message for the Insert, however when there is a datagrid
involved in your operation than the dataset is in my opinion the way to go.

In this resource kit is a master detail grid, however I thought not the
updating, when you are at that point using the dataset, ask again using this
samples, than it is not that difficult anymore.

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbrkit/faq/#installvdir

I hope this helps a little bit?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top