Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Retrieving datarows using DataTable.Select method and adding it to new DataTable
how to do this me Please
[no name] 3-May-12 7:42am    
What have you tried?

1 solution

Use the following steps.

  1. Create a blank new DataTable from the DataTable whose data is to be copied using DataTable.Clone method explained here[^]
  2. Retrieve the array of DataRows from the DataTable using the Select method explained here[^]
  3. Iterate all the rows of the array using a Foreach loop and import each row into the newly created DataTable using ImportRow method explained here[^]
Share this answer
Espen Harlinn 3-May-12 8:44am    
VJ Reddy 3-May-12 8:49am    
Thank you, Espen.
Member 8405530 3-May-12 8:45am    
thank u have any sample codings
VJ Reddy 3-May-12 8:54am    
Examples are given at the references given in the solution. Please try yourself using the above references.
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900