I have many columns corresponding to unique candidateno,
I dont want to copy the result to new table, i mean i dont need a new table, i just want to find the indexof first occurance of the Unique id and then move to next unique id in a for each row…
Why does it matter if you use a new datatable with the duplicate rows removed, or if you use the existing datatable and skip duplicate rows? The end result is exactly the same, but it’s much easier programmatically to just create a new datatable variable than it is to code something that skips over rows on your existing table. New datatable is quicker to code, easier to read/understand, and will be faster to process
Just use a for each row loop, capture the value of the index in a variable, and use an if statement that compares the current index to the variable; if they are equal then X else Y