Copy
DataTable copyTable
= DataTable.Copy();
Creates a new DataTable
with the same schema and
data as the current DataTable
.
The following example shows how to create a new empty
DataTable
with the same schema and data as an
existing DataTable
:
DataSet dt1 = new DataTable(); // ... define the schema for the DataTable // ... add some rows to the DataTable // Create DataTable dt2 with the same schema and data as DataTable dt1. DataTable dt2 = dt1.Copy();