Store multiple datarows in array of Datatable

Hi All,

I am reading excel files. if the rows in excel files are same i want to store it in different datatable.

right now, I am using out_DT.Select("[Document Date] =’"+ DocumentDate+"’ ") assigned to Array of Datarow and DT.CopyToDataTable() to store into one Datatable

But i want to store multiple Datarows in Array of Datatables?

Tejaswini H R

–hope we have a datatable named A
–create another datatable B with Build datatable activity with same datatable structure
–now use a for each row loop and pass the variable A as input
–inside the loop use a if condition like this
row(“Document Date”).ToString.Equals(DocumentDate.ToString)
if true it will go to THEN part where we can use Add data row activity and in the property panel of that activity mention as row.ItemArray in the ArrayRow property and in the datatable property mention as B

this will add all the the datarow that matches the condition to the new datatable B

hope this would help you
Cheers @tejuhr

@tejuhr - I’m a bit confused by your question. So now you have an array of datarows. You want to copy all of those datarows to each datatable in the array of datatables?

If so, just do a For each loop as follows: For each dt in MyDtArray (TypeArgument = datatable) Assign dt = MyDataRowArray.CopyToDataTable()

If you want to put specific rows from the array into specific datatables, you do the same thing, but have to include some more filter logic with .Where() or .Select() statements

@Palaniyappan I am not sure how many such Datatable B should be created. I want to make that dynamic.

Tejaswini H R