Best way to copy Data from one DataTable to another DataTable with diffrent structure

后端 未结 2 1500
隐瞒了意图╮
隐瞒了意图╮ 2021-01-26 00:02

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.

What will be the

2条回答
  •  花落未央
    2021-01-26 00:38

    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.

提交回复
热议问题