How to pass first row in for each row?

Hi. I have a datatable and I am using For Each Row activity for this datatable. But I want to pass the first row in For Each Row. How can I do this

1 Like

@sufyant
image

first time you get first row of datatale if you don’t want to continue to next row then after opeation on first row use break activity to exit the loop

1 Like

but I want to pass just first row ?

For each row is used for collection not for single row
if you want work only first row so why you use For each Activity

1 Like

I know but this can be done like that. But I dont know how to write this

if row index = 0 break, else dont do anything

1 Like

Hi
We can use a assign activity like this with no for each row activity
dat_rowvalue = datatable.Rows(0)
Where dat_rowvalue is a variable of type System.Data.Datarow

Cheers @sufyant

1 Like

Dt.Rows(0) assign to a data row variable

in vb
Dim dr as DataRow = dt.Rows(0)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.