How to append one DataTable to another DataTable

后端 未结 6 1084
臣服心动
臣服心动 2020-12-10 09:59

I would like to append one DataTable to another DataTable. I see the DataTable class has two methods; \"Load(IDataReader)\" and \"Merge(DataTable)\". From the documentation

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-10 10:30

    The datatype in the same columns name must be equals.

    dataTable1.Merge(dataTable2);
    

    After that the result is:

    dataTable1 = dataTable1 + dataTable2

提交回复
热议问题