finding distinct count of records in my dataset

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?
scm0smlAsked:
Who is Participating?
 
klakkasConnect With a Mentor Commented:
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
 
scm0smlAuthor Commented:
ok and presumably if i wanted to find two distinct fields ai would just add another field name to the string array....correct?
0
 
klakkasCommented:
Correct! :-)
0
 
scm0smlAuthor Commented:
ok excellent thanks for that!
0
 
klakkasCommented:
No problem, glad I could help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.