Loop through for each and put the 4th or 5th row value to another variable .. is it possible?

Hi All,

I am having a variable
Indexrow= 4

Now in For each loop i am doing like this

When - Foreach reaches the 4th row then only i want to take its value to the variable - Counted qty


indexrow is of the type string or int.? if it is int you cannot compare int with string,
use convert.toint32(row.item(“colname/colindex”).tostring)=indexrow


Hey both are integers…

then don’t use .tostring() in if condition


The condition is not getting full filled…
Its not going inside the If block.

I have assigned
I cant change it to Int32
As the Indexrow has numberic value of =4


I just checked it in debug mode- the above code - convert.toint32(row.item(
Qty Counted”)) — is not getting the index of row , rather its getting the value inside that index… i just want to find the index


I got it




If you know the row number before then you can directly use like this
Dt.riws(rowcount).item(column name)
Then you can convert into integer

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