gregasm
asked on
DataTable.Select() method
I have a datatable with a column named desc1. desc1 is not unique, but I would like to return an array of datarows using the select method. I've used this select expression
"desc1 = 'something'"
But that returns all the rows that have desc1 = 'something', but I want only the rows with distinct values for desc1.
like, a select distinct statement.
Is there any way to do this in the filter expression?
"desc1 = 'something'"
But that returns all the rows that have desc1 = 'something', but I want only the rows with distinct values for desc1.
like, a select distinct statement.
Is there any way to do this in the filter expression?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DataTable.Select, method can handle only Expression , sorting and DataviewRowstates. U cannot use this Select method to obtain distinct values in a batch of records. Probably wht u can do is that loop through The Datatable and remove the duplicated values. But the best way is to do that before filling the Datatable. I.e., change the query which u have used to fill up the datatable in such a way that select distinct values
Don