Getting List of Duplicate Rows with Unique Multiple Columns - LINQ

give a try at:

(From d in dtData.AsEnumerable
Let sk = String.Join(“_”,{“UID”,“Name”,“Gender”,“Age”}.Select(Function (x) d(x).toString.Trim))
Group d by k=sk into grp = Group
Where grp.Count > 1
From g in grp
Order by dtData.Rows.IndexOf(g)
Select r=g).CopyToDataTable

4 Likes