I am trying to delete the duplicate records from the excel. I have used “Delete Duplicate Rows” but it is not working and I also used DT.Defaultview.ToTable(True,“Columnname1”,“Columnname2”) and it is working if I take only 2 Columns where the values are same, but it will save only these 2 columns in the DataTable variable and if I take all variables in the above code, then it is not deleting the Duplicate rows. How can I achieve this. For more clearity, I have attached the screenshot.
dt.AsEnumerable().GroupBy(Function(i) i.Field(Of String)("ColumnName")).Select(Function(g) g.First).CopyToDataTable() Or ((From LineNo In dt.DefaultView.ToTable(True,"Product").Select().ToList() Select (From row In dt.Select Where row("Product").ToString=LineNo("Product").ToString Select row).ToList(0)).ToList()).CopyToDatatable()
You can use multiple values
Thanks
Ashwin.S