C
Christopher Weaver
I've filled a DataSet with two tables then established a DataRelation; all
is well because the backend includes RI rules that ensure that no record on
the detail side will be without a master record. However, there are too
many records on the master side for an efficient use of the app over the web
via website or VPN. So, I've implemented Fill(ds, int, int, dt) such that I
control how many records are downloaded. Now the problem is that the detail
table is left with many records that have no corresponding records on the
master side and the DataRelation won't take.
My question is what is the best method of fetching only the related records?
I've seen GetChildRows, but I'm hoping that there is a 'built-in' way of
doing this through the DataAdapter. If not, then my question is do I use
this or something like it:
DataRow[] arrRows;
foreach(DataRow masterRow in masterTable.Rows){
arrRows = masterRow.GetChildRows(myRelation);
....
}
If so, how do I get arrRows into the correct Table of the DataSet? Is
foreach with the Add method of the DataRowCollection class the way to go
with this?
Thanks.
is well because the backend includes RI rules that ensure that no record on
the detail side will be without a master record. However, there are too
many records on the master side for an efficient use of the app over the web
via website or VPN. So, I've implemented Fill(ds, int, int, dt) such that I
control how many records are downloaded. Now the problem is that the detail
table is left with many records that have no corresponding records on the
master side and the DataRelation won't take.
My question is what is the best method of fetching only the related records?
I've seen GetChildRows, but I'm hoping that there is a 'built-in' way of
doing this through the DataAdapter. If not, then my question is do I use
this or something like it:
DataRow[] arrRows;
foreach(DataRow masterRow in masterTable.Rows){
arrRows = masterRow.GetChildRows(myRelation);
....
}
If so, how do I get arrRows into the correct Table of the DataSet? Is
foreach with the Add method of the DataRowCollection class the way to go
with this?
Thanks.