Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Detect duplicate entries in datatable rows

Posted on 2008-10-20
6
Medium Priority
?
598 Views
Last Modified: 2013-11-05
Hi!

I have a datatable with the following columns:

givenname, surname, title, dept, identifier

Now I have thousands of rows like this for each user in the company:

Bill,Gates,,IT,1000

As some of the users have the same name, I have something like this:

Bill,Gates,,HR,2678

Now I want to detect these users and write the identifier (as this is unique) of these users to a list(of string).

How can I do that?

Thanks, Jan
0
Comment
Question by:janwrage
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 1

Accepted Solution

by:
janwrage earned 0 total points
ID: 22756079
Hi again,

I know I could read one rows data (givenname, surname) and then loop thru the remaining and compare it to them.
But this is very time-consuming as for each entry, I need to loop thru all remaining rows and this is very slow.

Jan
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 800 total points
ID: 22756132
I think if you use the group by clause in the SQL statement when loading data, it should group the names together and give you the count, For example
Select GivenName, Surname, Count(Surname) From Table Group By GivenName, Surname
0
 
LVL 1

Author Comment

by:janwrage
ID: 22756153
How do I do that in VB?

The table is filled by some CSV-Parser, so no SQL...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 22756183
Then you need to loop through the table i think. Or if you are using VB.NET 2008, try using LINQ. Check out these links
http://geekswithblogs.net/azamsharp/archive/2006/04/21/76054.aspx
http://www.codeproject.com/KB/vb/Merging_two_DataSets.aspx
0
 
LVL 1

Author Comment

by:janwrage
ID: 22756257
Thx, I'll check it out.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 22766500
did provide a solution which the asker choose not to implement
0

Featured Post

Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question