Select distinct ?

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

I have set a dataview on a datatable and I want to know the distinct value
for one of the columns in the dataview.

Is there an easy way to do this?
 
This may not be the best way to do it (as it really depends on the context),
but you can try this:

MyDataTable.Select("MyExpression = MyValue")(0).Items("MyColumnName").

In english: select an array of DataRows from the datatable based on some
expression - grab the first one in the array, and pull out the value in the
specified column.
 

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

Back
Top