dataset, for each parent/child result handling?

cwfontan

Active member
Joined
Jan 9, 2009
Messages
35
Programming Experience
1-3
dataset contains two tables

I use a parent child datarow to filter through the tables and find related fields, I am wanting my results to be put into a datagridview. How is this possible?

ds As New DataSet
table1
table2
da.Fill(ds, table1) & da.Fill(ds, table2)

For each parentRow as DataRow in ds.tables(0)
'get data

For Each childRow as DataRow in ds.tables(0)
If ds.tables.rows.item("whahoo") = whahoo then
'do something
'getresults
end if
next
'insert all the data into dataset, spreadsheet,gdataridview??
next
 
The dataset is a container that holds as many datatables as you want. However you can only assign one table at a time to be viewed in a DataGridView control. I dont know how many columns of info are in each of your tables but it sounds as if you want two DataGridView controls, one to show all the parent records and when they select a record the child DGV will show all the associated child records.
 

Latest posts

Back
Top