DataTable table = new DataTable(); //add in tables table.Columns.Add("Column 1", typeof(int)); table.Columns.Add("Column 2", typeof(int)); //add in rows table.Rows.Add(1, 2);
That would mean iterating through dbf and grabbing the column names, then inserting them 2 for each (column) loops, and then adding your own columns that you need. You can also delete any link columns that are identical in each column.
Then 2 more for each row (row), and you can fill in the rows of data.
All that remains is a for each row in the table to calculate the values ββof the custom columns for that row.
Depending on the dbf relationship, you can just tweak the loops.
source share