What is the best way to remove duplicate entries from a Data Table?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
There is a simple way using Linq GroupBy Method.
A simple way would be:
Heres a easy and fast way using
AsEnumerable().Distinct()
CLICK to visit my blog for more Detail
Remove Duplicates
Here Links below
http://www.dotnetspider.com/resources/4535-Remove-duplicate-records-from-table.aspx
http://www.dotnetspark.com/kb/94-remove-duplicate-rows-value-from-datatable.aspx
For remove duplicates in column
http://dotnetguts.blogspot.com/2007/02/removing-duplicate-records-from.html
Completely distinct rows:
Distinct by particular row(s) (Note that the columns mentioned in "distinctCulumnNames" will be returned in resulting DataTable):
Distinct by particular column (preserves all columns in given DataTable):