B
Burt
I have a db with two tables, Parent and Child. A Parent will always
have 1 or 2 children: Child1, Child2, or both children. I'm writing a
C# windows app over these tables. The user, in a datagridview, will be
able to view, update, etc. the data.
Problem is, I have to flatten the two tables into one row in the dgv
per parent item. The three possible combinations, flattened, are shown
below:
Parent_ID1, Child_ID1, ChildID_2
Parent_ID2, ParentName2, Child_ID_1, null
Parent_ID3, ParentName3, null, ChildID_2
I have to display 20 or so fields for the parent and each of the 1-2
child rows. Any ideas how to handle this? I'm looking at creating a
temp table, flattening, then displaying on the grid. Others have
suggested flattening on the front end via DataTables. And how to
update the relational tables upon edit?
Thanks,
Burt
have 1 or 2 children: Child1, Child2, or both children. I'm writing a
C# windows app over these tables. The user, in a datagridview, will be
able to view, update, etc. the data.
Problem is, I have to flatten the two tables into one row in the dgv
per parent item. The three possible combinations, flattened, are shown
below:
Parent_ID1, Child_ID1, ChildID_2
Parent_ID2, ParentName2, Child_ID_1, null
Parent_ID3, ParentName3, null, ChildID_2
I have to display 20 or so fields for the parent and each of the 1-2
child rows. Any ideas how to handle this? I'm looking at creating a
temp table, flattening, then displaying on the grid. Others have
suggested flattening on the front end via DataTables. And how to
update the relational tables upon edit?
Thanks,
Burt