How to copy DataRow to DataTable in asp.net

Introduction: In previous articles i explained How to Copy one DataTable to another in asp.net and  Difference between DataSet and DataTable in asp.net and How to bind gridview using DataReader,SqlCommand and Stored procedure in Asp.net

 In this article i will explain how you can  copy DataRow to DataTable in asp.net.


C#.Net Code to copy DataRow to DataTable in asp.net

DataRow[] dr= new DataRow[10];
DataTable dt= new DataTable();
dt.LoadDataRow(dr, true);

VB.Net Code  to copy DataRow to DataTable in asp.net

Dim dr As DataRow() = New DataRow(9) {}
Dim dt As New DataTable()
dt.LoadDataRow(dr, True)

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..