I need to remove duplicate based on two column, if YY no column is duplicate but XX no column unique means I don’t want to delete, both column (YY no and XX no) duplicate than only remove duplicate , I couldn’t able to do so please help me anyone for this.
(
From row In yourDatatableVariable
Group row By
k1 = row(“XX no”).ToString.Trim,
k2 = row(“YY no”).ToString.Trim
Into grp = Group
Select grp(0)
).CopyToDataTable
(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)