add a row to a datatable from a row in a different datatable
i am currently doing this:
for (int i = 开发者_C百科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?
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]);
精彩评论