I have a data table , i need to delete the duplicate rows wrt 2 columns,
Assign Activity
dtCleansed =
(From d in YourDataTableVar.AsEnumerable
Group d by k1=d("Col1").toString.Trim, k2=d("Col2").toString.Trim into grp=Group
Where grp.Count = 1
Select r=grp.First()).CopyToDataTable
it will keep only the rows which are unique based on the 2 cols and removes all rows which occurs more ofent based related to this 2 cols
Just update within the LINQ the colnames as to your col names
DT.Asenumerable.Groupby(Function(r) Tuple.Create(r(“Col1”),r(“Col2”)).Select(Function(g) g.First).Copytodatatable