?
Solved

finding distinct count of records in my dataset

Posted on 2010-09-23
5
Medium Priority
?
435 Views
Last Modified: 2012-06-21
I have a dataset
dim objBatchRecords as new dataset

There is a field in there called supplier.

I want a count of the distinct suppliers.

Is there a way of finding this from the dataset and if so how?
0
Comment
Question by:scm0sml
[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
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
klakkas earned 2000 total points
ID: 33741839
You can get the distinct Suppliers using these commands:

       dim DistinctColumns(0) as string
       DistinctColumns(0)  = "suppliers"
       Dim DistinctSuppliers As DataTable= objBatchRecords.Tables(0).DefaultView.ToTable(true, DistinctColumns)

0
 

Author Comment

by:scm0sml
ID: 33741869
ok and presumably if i wanted to find two distinct fields ai would just add another field name to the string array....correct?
0
 
LVL 7

Expert Comment

by:klakkas
ID: 33741887
Correct! :-)
0
 

Author Comment

by:scm0sml
ID: 33741889
ok excellent thanks for that!
0
 
LVL 7

Expert Comment

by:klakkas
ID: 33741896
No problem, glad I could help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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