Would like to filter my data-table by a specific column so that each value in that column is unique. I am keeping all the columns in the output data table.
can you give an example of input and expected output?
Lets assume your dt has some columns like
And you want deduplicate / distinct on first column & from groups with the same Col1 value we will take the first occurence
For a result as:
we can do:
dtResult | datatype: DataTable =
(From d in YourDataTableVAr.AsEnumerable
Group d by d(“Col1”).toString.Trim into grp=Group
Select r = grp.First()).CopyToDataTable
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.