How to Copy one DataTable to another in asp.net

Introduction: In previous articles i explained How to copy DataRow to DataTable in asp.net and  How to create thumbnail, small and large version of the uploaded image in Asp.net? and  Validate and upload image files in asp.net

  Now in this article i will explain how to copy one DataTable to another in asp.net.Suppose we have a DataTable dt having some data and we want to copy this DataTable dt to another DataTable dtNew  then here is the way:

C#.Net code to Copy one DataTable to another in asp.net

DataTable dt = new DataTable();
DataTable dtNew = new DataTable();
dtNew = dt.Copy();

VB.Net code to Copy one DataTable to another in asp.net

Dim dt As New DataTable()
Dim dtNew As New DataTable()
dtNew = dt.Copy()
Previous
Next Post »

If you have any question about any post, Feel free to ask.You can simply drop a comment below post or contact via Contact Us form. Your feedback and suggestions will be highly appreciated. Also try to leave comments from your account not from the anonymous account so that i can respond to you easily..