tags:

views:

34

answers:

1

how can I copy specific rows from datatable to another datatable in c#? more than on row

+2  A: 
foreach (DataRow dr in dataTable1.Rows) {
    if (/* some condition */)
        dataTable2.Rows.Add(dr.ItemArray);
}

The above example assumes that dataTable1 and dataTable2 have the same number, type and order of columns.

Bradley Smith
I have to admit your code is better.
Lee Sy En