This is how I search a Dataset...
Code:
'Create a dataview
dim dv as new dataview
'Associate the dataview to _oDs (Dataset table)
dv.Table = _oDs.Tables("tblCapitalCategory")
Dim drv As DataRowView 'Data Row View object to query DataView object
'Filter based on a combo box value selected
dv.RowFilter = "[pkCapitalCategoryID] = " & CInt(cboComboBox.SelectedValue)
'Retrieve my values returned in the result
For Each drv In dv
_dteDateModified = drv("dteDateModified")
Next
Hopefully you get some use of this. I use this method to search for any values in my datasets.
Code:
dv.RowFilter is the key to the search. It is kind of like a SQL where statement on the results of the dataset.
The nice thing about this method is the original dataset is not manipulated in any way. You do everything based on a manipulated view of the datasets results.
Bookmarks