In this example, columnA must be unique.
ColumnA | ColumnB
1 | a
1 | b
1 | b
2 | a
2 | a
3 | b
3 | c
3 | d
the result has to be
1 a
2 a
3 b
In this example, columnA must be unique.
ColumnA | ColumnB
1 | a
1 | b
1 | b
2 | a
2 | a
3 | b
3 | c
3 | d
the result has to be
1 a
2 a
3 b
@Gilberto_Marinho
Give a try on YourDataTableVar.AsEnumerable.Distinct(DataRowComparer.Default).CopyToDataTable
to retrieve the Distinct Rows
In your example you should clear 3b is fetched due the ordered occurence and that this has no sideeeffects
With a group by and fetching the first row from each group you will get the result
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.