Find duplicate rows in datatable

S

steve

Hi All

I need to detect duplicate rows in a datatable in VB net 2003 using MS
Access 2K

I can do it at database level with sql e.g
sql = "select membernumber from members group by membernumber having
count(membernumber) > 1"
dt = getdata(sql, "dupes") ' getdata is my sub routine which returns a
datatable

Can you do a similar thing querying an Ado.net Datatable?

i.e can you do advanced querying on a populated datatable?

Any tips appreciated

Regards

Steve
 
M

Miha Markic [MVP C#]

Hi steve,

steve said:
Hi All

I need to detect duplicate rows in a datatable in VB net 2003 using MS
Access 2K

I can do it at database level with sql e.g
sql = "select membernumber from members group by membernumber having
count(membernumber) > 1"
dt = getdata(sql, "dupes") ' getdata is my sub routine which returns a
datatable

Can you do a similar thing querying an Ado.net Datatable?
No.


i.e can you do advanced querying on a populated datatable?

No. Well, depends on what advanced means to you.
There is DataTable.Select method (see DataColumn.Expression for supported
expressions).
There is also a commercial product that claims it can do sql queries on
dataset (search through this newsgroup - it is advertised from time to
time) - I have never tried it though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top