Solved

finding distinct count of records in my dataset

Posted on 2010-09-23
5
428 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 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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