user354547 user354547 - 4 months ago 14
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

DataTable.Clone() should do the trick.

public DataTable CloneTable (DataTable originalTable)
{

DataTable newTable;
newTable = originalTable.Clone();

return newTable;

}