How to remove duplicate based on two column

in addition to Ömer we can do following:
grafik
dtResult =

(From d In dtData2.AsEnumerable
Group d By  k1=d(0).toString.Trim,  k2=d(2).toString.Trim Into grp=Group
Where grp.Count  = 1
Select r = grp.First()).CopyToDataTable

Here we used the 2 cols for the grouping and fetching only the rows when group.count = 1
So we ommited 880, 88887779 - Kannan, Kala

But we do feel that your requirement is different. Maybe you can recheck with some other samples

Also have a look here (Non-LINQ, LINQ Approaches described)

1 Like