Copy Dataset column data to multiple sources
Posted on 2008-06-25
I have a question regarding datasets.
I have a dataset with several datatables. One or more of these tables will be required at runtime. Most of these tables have columns (and data) in common, and they will all end up with the same number of rows.
I am using datagridviewrows to allow the user to populate the tables with data. To prevent the user having to repeatedly enter the same information into several tables I reckon I should;
1 - create a new dataset
2 - iterate through my existing tables and look for duplicate columns
3 - create a new column in my new dataset for every duplicate column
4 - display the new dataset in a datagridviewrow
The user enters the data once into the displayed datagridview. I would like the data in the column to be replicated to the datatables with a matching column.
Am I right in thinking that the only way to do this will be to copy the individual data items one-by-one in a For..Next for each table? I've looked but cannot find (understandably) a way to link a single column to multiple destinations.
Any other ideas? I know it sounds daft having repeated data in a dataset but user might need just one table, or several.
ps, I'm currently using XML to store sample data and saved dataset data. Maximum no. of records is likely to be <100.