Nila Nila - 1 year ago 251
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download