.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Code Snippets >> Collections >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Cloning datatable a useful feature

Posted By:nishithraj       Posted Date: December 27, 2009    Points: 10    Category: Collections    URL: http://www.dotnetspark.com  

Cloning datatable a useful feature. If we require to reuse the structure of a data table or dataset(not the data), we can go for the cloning option.

If this feature is not there in the dotnet, we require to get the data structure from the data table or dataset manually. That's a tedous job.

Code for cloning is as follows.

private DataTable CloneDataTable (DataTable DataTable1, DataTable  DataTable2)
    DataTable2= DataTable1.Clone();        
    return DataTable1 



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend