Hi,
I have a list of datatable,
How to loop through the datatable so i can use write range for each of the datatable and also how to find rows count for each of the datatable?
Hi,
I have a list of datatable,
How to loop through the datatable so i can use write range for each of the datatable and also how to find rows count for each of the datatable?
As it is a list of datatables, you can simply use for each activity @mashy2 to loop through
and datatable.rows.count will give you the count of datatable
Hi @mashy2
Hi,
I have lot of datatable,
How to use add to collection to create list of datatable.
This way seem wrong:

nope, i create the datatable
I hope we already have a list of datatable
If so may I know why do we need a list to be created with add to collections
— and to write and find the Count hope these steps could help you
—let’s take that you list of name out_dtlist
—now use a for each loop and pass the above variable as input and change the type argument as Datatable
— inside the loop use a write range activity from workbook activities and mention the datatable as item (the variable from for each loop as it holds the datatable now)
—mention the sheetname and filename as well in the write range activity
—and next to this use a write line activity like to get the count.
item.Rows.Count.ToString
Hope this would help you
Cheers @mashy2
@mashy2
You can Create Array of data-table and store all data-table in the array like this{datatable1, datatable}
In that case create a variable in the variable panel like this
Out_dtlist is the name
Type is System.Collections.Generic.List(of System.Data.Datatable)
And in the default value mention as
New list(of system.Data.Datatable)
— now in the add to collections
In the property collections mention the list variable like out_dtlist and in the item mention the datatable variable name we want to add
Hope this would help you
Cheers @mashy2
Thank you so much for everyone help!!!
Cheers @mashy2