Is there a way to filter the dataset to contain only distinct values?
ds.Tables("myTable").DefaultView.RowFilter() = "fname distinct" - I know
this doesn't work but I was wondering if it is possible.
We have asked for it to be included in future versions
Quote:> Is there a way to filter the dataset to contain only distinct values?
> for example:
> ds.Tables("myTable").DefaultView.RowFilter() = "fname distinct" - I know
> this doesn't work but I was wondering if it is possible.
I want to create two dataviews from the defaultview of a dataset and bind
them to two datagrid control. The problem is the first dataview rowfilter
always overwrited by the second one. Why?
Here is my code:
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = Nothing
dsService = New DataSet()
Dim dsEnabledService As New DataView()
Dim dsDisabledService As New DataView()
'create a new dataset from a string stream
Dim strTemp = .....
Dim stringReader As New StringReader(strTemp)
'create the first dataview
dsEnabledService = dsService.Tables(0).DefaultView
dsEnabledService.RowFilter = "stopped = 0"
'create the second dataview
dsDisabledService = dsService.Tables(0).DefaultView
dsDisabledService.RowFilter = "stopped = 1"
Catch ex As Exception
'bind the two dataviews to datagrid
DataGrid1.DataSource = dsEnabledService
DataGrid2.DataSource = dsDisabledService