S
sutphinwb
Hi - This could be a simple question. When I relate two tables in a
datasetet, how do I get that relation to show up in a GridView? The
only way I've done it, is to create a separate table in the dataset
with a join query for the GetData() select method. I use
ObjectDataStore to couple the GridView with the table adapter on the
dataset. If I point the ODS at the child table, the GridView will bind
to the "normal" select and I end up with the foreign keys displayed
verses the field in the parent table. That is the same thing that
happens with no relation.
What I end up doing is having a dataset with the parent and child as
unrelated tables w/ seperate adapters. I add a new table that is the
related data built via the join query. Since the update, insert,
delete methods can't be automatically created with this type table, I
create them myself and use the stuff passed in (the joined table row)
to update the child table.
I'd be happy to pass the FK to the gridview and let a bound control
figure out what to display from the parent table based on the child
table FK, but I haven't figured out how to do that with a Label.
TIA
Bill
datasetet, how do I get that relation to show up in a GridView? The
only way I've done it, is to create a separate table in the dataset
with a join query for the GetData() select method. I use
ObjectDataStore to couple the GridView with the table adapter on the
dataset. If I point the ODS at the child table, the GridView will bind
to the "normal" select and I end up with the foreign keys displayed
verses the field in the parent table. That is the same thing that
happens with no relation.
What I end up doing is having a dataset with the parent and child as
unrelated tables w/ seperate adapters. I add a new table that is the
related data built via the join query. Since the update, insert,
delete methods can't be automatically created with this type table, I
create them myself and use the stuff passed in (the joined table row)
to update the child table.
I'd be happy to pass the FK to the gridview and let a bound control
figure out what to display from the parent table based on the child
table FK, but I haven't figured out how to do that with a Label.
TIA
Bill