user354547 user354547 - 1 year ago 69
ASP.NET (C#) Question

how to copy only the columns in a DataTable to another DataTable?

how to copy only the columns in a DataTable to another DataTable?

Answer Source

DataTable.Clone() should do the trick.

public DataTable CloneTable (DataTable originalTable)
{

DataTable newTable;
newTable = originalTable.Clone();

return newTable;

}