Hi..
I want to convert an datarow array into datatable.. Wat is the simple way to do this?
Thanks in advance!!
Hi..
I want to convert an datarow array into datatable.. Wat is the simple way to do this?
Thanks in advance!!
DataTable dt = new DataTable();
DataRow[] dr = (DataTable)dsData.Tables[0].Select("Some Criteria");
dt.Rows.Add(dr);
Why not iterate through your DataRow array and add (using DataRow.ImportRow, if necessary, to get a copy of the DataRow), something like:
foreach (DataRow row in rowArray) {
dataTable.ImportRow(row);
}
Make sure your dataTable has the same schema as the DataRows in your DataRow array.