AWestEng
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
found it.. missing ' ' Thx man works perfect...
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"))
_dt.Compute("Count(DOB)", "DOB = " & dr("DOB") & " AND First Name = " & dr("First Name") & " AND Last Name = " & dr("Last Name"))
ASKER