How to use get row item with for each

There are a couple ways.

You can use “Get Item” activity and set up its parameters correclty.
Most don’t use that method however and instead use “.Item()” with the datarow.

So in order to get the datarow you can have this in a ForEach or hardcode the row with the datatable variable.

For example,
datatableVariable.Rows(0).Item(0).ToString
that will return the first column of the first row. You can also replace .Item(0) with .Item(“columnname”)

If you have it in a loop, then here is an example of that:
ForEach row In datatableVariable
MessageBox row.Item(0).ToString
Since row is a datarow within the datatable that works and is similar but you can go through each row.

Hope this helps.

Thanks.

12 Likes