Copying datatable contents to another datatable

  • Thread starter Thread starter VM
  • Start date Start date
V

VM

How can I copy the contents of one datatable to another datatable? I've
already the source table so I only need to copy its rows.

Thanks.
 
VM,
Are the table structures identical? (same fields, same types, same sequence
of fields)

I normally use a for each loop on the source table's rows collection then
DataTable.ImportRow on the destination table.

Hope this helps
Jay
 
Thanks, it worked.
The reason I created a copy of the table was so I could set the datagrid
datasource to this clone table while the main table is being filled. So I
copy the data from one table to the other every 1500 records. The problem is
that once I set the datasource, I keep on seeing the grid being updated. And
it shouldn't, since I copy the data from one table to another every 1500
records so the grid should be updated with 1500-record chunks (not
individually).

Am I doing somethinw wrong?
 
VM,
It sounds like you bound to the wrong DataTable.

Without seeing your code it would be hard to actually say.

Hope this helps
Jay
 
Back
Top