I have a data table consist of two columns(Name, value). How can I get the row index for a proper value? Because whenever the process executed row index fetched the value and that is added up by 2. Please suggests some way.
Thanks in advance.
I have a data table consist of two columns(Name, value). How can I get the row index for a proper value? Because whenever the process executed row index fetched the value and that is added up by 2. Please suggests some way.
Thanks in advance.
You can assign ForEachRow Index in output
Then u can get the current row index
@poulomi.de
I do understand that you want to ge the rowindex for a particular value e.g. name.
IndexOf() methods often return the first occurence
give a try on following LINQ:
assign activity:
left side: arrRowIndex (Datatype Of Int32()
right side
Enumerable.Range(0,YourDatatableVar.Rows.Count).Where(Function (x) yourDataTableVar.Rows(x)("Name").toString.Trim.Equals("YourSearchedName")).toArray
Can you please provide an example of how to use this to get proper row index even if duplicates are there ?
You can read the excel file and if want to get the row index against the specific value then add the if condition and then in the body of the if condition get the row index CurrentRow(ColumnName).ToString== Value. it will give you the row index.