I am copying data from DataTable to another DataTable with a structure.
I have to hardcode columns number in the loop and copy the data in object array.
Probably, check out Adapter pattern, it will allow you to adapt the structure of one data table to another. A simple explanation and sample code can be found at Dofactory.