Delete duplicates in datatable

Hi There, I’m trying to find a method to remove duplicates that doesn’t consider uppercase and lowercase words. I’m using these methods but all of them keeps duplicates if the capitalization is different.

Example of a duplicate: “C Level” and “c level”

  • DT.DefaultView.ToTable(True,“ColumnName”) - Not working: keeping both

  • DT.AsEnumerable().GroupBy(Function(i) i.Field(Of String)(“ColumnName”)).Select(Function(g) g.First).CopyToDataTable() - Not working: keeping both

  • Remove Duplicate Rows activity - Not working: keeping both

It should be done at a datatable level, looping through the records is not possible due the volume

Any idea would be much appreciated… thanks !

sure that above is not working as it is case sensitive

give a try on
DT.AsEnumerable().GroupBy(Function(i) i.Field(Of String)(“ColumnName”).toUpper()).Select(Function(g) g.First).CopyToDataTable()

2 Likes

HI ppr, thank you, it is working like a charm !

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.