Simulating SELECT DISTINCT in a RowFilter - how to?

Simulating SELECT DISTINCT in a RowFilter - how to?

Post by Hugo van Gorko » Wed, 17 Apr 2002 18:58:30



Hi, I would like to simulate a SELECT DISTINCT query, on a DataSet (rather
than going back out to disk).
I have a DataSet with a nicely populated DataTable - how would I go about
adding a DataView that contains _only_ unqiue values of a certain column?
The DataView is to be bound to a DropDownList. I know there's a GROUP clause
that can be used in a RowFilter expression, but I cant find its syntax.

I've had a quick look for this but found nothing so far... (appologies if
it's obvious)
The other method would be iterating through the entire table and inserting
into an array etc, but wouldn't be as clean.

Many thanks for any ideas,
Hugo

 
 
 

Simulating SELECT DISTINCT in a RowFilter - how to?

Post by George Li [M » Thu, 18 Apr 2002 23:54:29


I have performed some research and found that there is no direct way to get
the "distinct" value of a column, you may need to iterate all the rows to
get a DataRow array.

This posting is provided "AS IS" with no warranties, and confers no rights.

Best Regards,

George Li

Microsoft Support

 
 
 

Simulating SELECT DISTINCT in a RowFilter - how to?

Post by Hugo van Gorko » Fri, 19 Apr 2002 03:53:12


Ok, thanks for checking that out for me.
Regards
Hugo



Quote:> I have performed some research and found that there is no direct way to
get
> the "distinct" value of a column, you may need to iterate all the rows to
> get a DataRow array.

> This posting is provided "AS IS" with no warranties, and confers no
rights.

> Best Regards,

> George Li

> Microsoft Support