Remove all rows in duplication (different from distinct row selection)

Posted by user1671401 on Stack Overflow See other posts from Stack Overflow or by user1671401
Published on 2012-10-02T09:23:25Z Indexed on 2012/10/02 9:37 UTC
Read the original article Hit count: 96

Filed under:
|
|

How can I remove EVERY duplicating row in a DataTable, based on the value of two columns that are in duplication. Unfortunately, I am unable to find the equivalent LINQ Query. (I dont want distinct values even). The table below shall explain my problem

I want to delete every row in duplication based on Column_A and Column_B

COLUMN_A      COLUMN_B      COLUMN_C     COLUMN_D.....
A                       B
C                       D
E                       F
G                       H
A                       B
E                       F

EXPECTED OUTPUT:

COLUMN_A      COLUMN_B      COLUMN_C     COLUMN_D.....
C                       D
G                       H

Please help

© Stack Overflow or respective owner

Related posts about c#

Related posts about datatable