I have a dotnetfiddle in which I show my data https://dotnetfiddle.net/UK2ZNX
I don't mind having a linq statement to group my data into an array , but I want to end up with a for loop (not foreach) for simplicity on looping over my data and when finding the duplicates stored in say an array, then I can manipulate them a bit
for(int i = 0; i < table1.Rows.Count; i++)
{
Console.WriteLine("ID="+table1.Rows[i][0] + " Name=" + table1.Rows[i][2]);
//troublecalls.Add(TroubleCallModel.CreateTroubleCallFromRow(myDT.Rows[i]));
}
I was trying to store some data in Hashset
HashSet<int> hs = new HashSet<int>();
but I don't think that was helping me
Based on my dotnetfiddle output
I have duplicate ID of 23 and 44 and 64
Instead of seeing
ID = 44 Name = Fido
ID = 44 Name = Thad
I want to combine and see
ID = 44 Name = Fido, Thad
Likewise for any duplicates ( currently in dotnetfiddle are also 23 and 64)
Reason for the wanting a for loop is that I have like 30 columns in my real data and I want to be able to remove / change / not show etc.. other columns
Just not sure what the best approach is