Reputation: 8108
i am currently doing this:
for (int i = 0; i < 15; i++)
{
dt_final.Rows.Add(dt.Rows[i]);
}
but i am getting an error that this row belongs to another table. how do i import this row to dt_final table?
Upvotes: 1
Views: 6477
Reputation: 14755
you can only add rows that where created from the DataTable (ie throug NewRow). But you can import a row from a different table
dt_final.ImportRow(dt.Rows[i]);
Upvotes: 5