Adding data to a new row in DataTable

Hi, I have an iEnumerable collection which I want to place as a row in a DataTable. The DataTable contains information which the iEnumerable does not have i.e. which column has a certain column title

iEnumerable collection is associated with one row. so iEnumerable index 0 goes to the new DataRow at index 0, iEnumerable index 1 goes to the new DataRow at index 1, etc

So the iEnumerable items get associated with their respective column names as a DataRow

How do I do this?

1 Like

Innumerable can be converted to a array with simple .ToArray() along with a ienumerable variable like yourvariable.ToArray()
So once after converting this to a array we can add to a datatable as a new row with add datarow activity
— in the add datarow activity we got a property called array row where mention this
But make sure that the number value in the array must match with the number of columns in the datatable

Hope this would help you
Kindly correct me if I make wrong with question

1 Like


Hi, how do I convert 1-dimensional array of Object to 1-dimensional array of String?

Yes like this
Sorry for the delayed response