Link to home
Start Free TrialLog in
Avatar of AWestEng
AWestEngFlag for Sweden

asked on

Find duplicates in DataTable object (VB.Net)

Hi.

I have a datatable (not a database table just the object datatable in VS.Net) (Dim dt as Datatable)

this datatable has 10 columns call them C1, C2, C3 ... C10

I like to check if there are any records in this table that has the same values in C1 C2 and C3 and then sort them out to another table.

The data is read from a CSV file and not a databse so I can't solve this in a database I nned to do it with code.

So I need one table with all the data that has no duplicate
and the other with all dupilcates

Ex

there are two rows that has same data on C1,C2 and C3, these TWO rows go to duplicatesTable the other rows go to DistinctTable.

How can I solve this..

thx guys.
ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AWestEng

ASKER

I get a syntax error missing operand after 11-operand
found it.. missing ' ' Thx man works perfect...
Avatar of jbogart23
jbogart23

Where was the missing '' ??? I'm getting same error, not seeing it

_dt.Compute("Count(DOB)", "DOB = " & dr("DOB") & " AND First Name = " & dr("First Name") & " AND Last Name = " & dr("Last Name"))