Copying Rows from One Table to Another – C#
Use Clone method to copy the table structure (Schema)
DataTable dtProductCopy = new DataTable();
dtProductCopy = dtProduct.Clone();
Use the ImportRow method to copy from Product table to its clone
for (int i = 0; i < dtProduct.Rows.Count; ++i)
{
dtProductCopy.ImportRow(dtProduct.Rows[i]);
}
Tags: how to copy selected rows from one table to others in c#, asp net c# importing rows from one data table to another on button click, silverlight copy row from one table to another, In c# copy data from one grid to another grid use clone, how to dump one table to another table using c# net, how to copy the row values from one table to another table using C#, how to copy table row from one table to another in asp net, how to copy selected rows from table to another in asp net using c#, how to copy selected data of one table to another using c# net, how to copy a table into another in c# net
Related posts:
- Copy Data from One Table to Another Table in SQL Server
- Delete duplicate rows from a table in SQL Server
- Check if a table exists in SQL Server
No Comments