How can I convert a DataRow array to a DataTable without iteration?
You can use:
dataTable = datarowarray.CopyToDataTable()
but ensure that datarowarray
has length > 1
, otherwise it will end up with unwanted exceptions.
I dont think you can put an array of datarows to a datatable. You can import one row at a time using DataTable.ImportRow.
foreach(DataRow row in dataRowArray)
{
dataTable.ImportRow(row);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With