more precise definition on defining of deletion of duplicates:
deletion of entire duplicates, keeoing one record…
the query syntax of LINQ
Lets play with following:
(From d in YourDataTableVar.AsEnumerable
Group d By k=d(2).toString.trim Into grp=Group
Where grp.Count > 1
Select grp.First()).CopyToDataTable
with this pattern we can control and adjust: Where grp.Count = 1
catch all Non Duplicates - Removing the duplicates we can do within a second step and set operation Except
Where grp.Count > 1 Select grp.First())
Take from all duplicates the first
Where grp.Count >= 1 Select grp.First())
Take all non duplicates and take from all duplicates the first
So feel free to give it into a play round. In case of you need more help let us know more requirements on the sample input, sample expected output
When I download excel, it didn’t have any column names, so I have added column names and wrote LINQ. Are you getting any error while running the attached xaml?