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.
 
Back
Top