Copy all Rows from Datarow to DataTable in C#.

Posted by Vishalneeraj-24503 under ADO.NET category on | Points: 40 | Views : 563
Sometime we may need to copy all rows from data row to datatable,in this case use below C# code to achieve

DataRow[] dtRow = dt_employee.Select();//Select records from Datatable and load into DataRow
DataTable Newdt = dtRow.CopyToDataTable<DataRow>(); //CopyToDataTable returns the datatbale that contains
the copy of datarow objects.

Comments or Responses

Login to post response