Nila Nila - 11 months ago 136
C# Question

Simple way to convert datarow array to datatable

I want to convert a

array into
... What is the simplest way to do this?

Answer Source

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) {

Make sure your dataTable has the same schema as the DataRows in your DataRow array.