user354547 user354547 - 2 months ago 7
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;

}
Comments