1

What I am trying to do is have a Parent Datatable which will collect values from Sub Datatable for each row of Parent Datatable.

Something like this enter image description here

I am not able to wrap around how to go about creating dynamic Datatable for each row of data added to the Parent Datatable and have table name of sub Datatable which can be identified with the row number and the same can be retrieved in another datagridview while selecting each row when trying to edit.

I, hope was able to communicate what I am looking for.

Thank you.

abhay9
  • 67
  • 6
  • 1
    Does this help ? [Showing parent datatable in one datagridview and show child datatable elements in another?](https://stackoverflow.com/q/38518081/6843158) – Kate Jul 04 '20 at 21:03
  • 1
    Why would you have a separate child table for each parent row in the first place? That completely ignores why relational databases are relational. You should almost certainly have a single child table that has a column that contains the ID of the parent record that each child record is related to. If you want child data for one parent record then you simply filter the child table by the ID of that parent record. That is what pretty much everyone always does so, if you have a valid reason to do otherwise, I'd be interested to hear it. – jmcilhinney Jul 05 '20 at 03:48
  • @jmcilhinney thats again what I was considering to do. in fact in database it store's in the same way. But there are certain issues which I can solve easily if I have this setup at data capture point, but I will face issue while saving it. I think I will go with your idea, Thanks again :) – abhay9 Jul 05 '20 at 07:10

0 Answers0