Make a new DataTable with the same columns as another DataTable

前端 未结 2 1366

I want to create a new DataTable that has the same columns as another DataTable.

Currently, I do the following:

DataTable myTable = new DataTable();
         


        
2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-07 22:20

    Use the Clone method - it creates a copy of the schema (columns) only.
    See DataTable.Clone

提交回复
热议问题