How to compare the Data rows of the particular column.
For example
There are 7 records in data row i need to compare 1st value to all and 2nd value to all similarly for all the records, if the records matches the row value should be write it into console.
Step 1 - You need to get the Row count of DataTable & store it in a variable
Step 2 - Create a Loop and check like [DataTable_Name].Rows([Row_Index]).Item([Coulumn_Index] or [Coulumn_Name]).ToString() = [DataTable_Name].Rows([Row_Index] + 1).Item([Coulumn_Index] or [Coulumn_Name]).ToString()
Note : Ensure your loop should run until [Row_Count] - 1, because if it run until last row, there will be an error occcur.
My requirement is like i have to find the duplicate in a particular column and if its a duplicate then i need to concatenate the other column values(which are not duplicate)…
hi guyz can anyone tell me how to determine row index while iterating through for each so that i take the similar value occuring for first time.
based on my condition there are 3 rows with similar calue i just need to grab the first value from other column.Please help
Thankyou josh got it.but how should I stop the iterationand get a value from only first row and not iterate further.
My condition is
If
Site_ID = MSL05608
Then assign
Carrier = the first value ie 2c
But I am getting 4C
Please help
I just want to get value from column Carrier as 2C ie when rowindex is 0
Hi there @1vivek12,
I’m not 100% certain I understand your issue, you can assign the row index upon finding your required row and then use the ‘Break’ activity to stop the iteration.
Do you just want to remove any duplicate entries within your DataTable, based on the ‘Carrier’ column?