|
Question : How to run SELECT statement against DataSet object
|
|
I have created a DataSet object and loaded few tables into it (they come from different data sources). As there are relations between them, I also created appropriate Relations objects. Now I would like to extract some data based on certain criteria. In other words, is it possible to run a SELECT statement against a DataSet object? (Or any other way how to extract desired data from this object?)
Note: filtering (if it's possible) is not the best way, as I need to preserve the DataSet object in its original state.
thanx a lot. Darkriser
|
|
Answer : How to run SELECT statement against DataSet object
|
|
You can try select from one dataset to another. Something like that
Private Sub FilterTable(ByVal sParam As String) Dim newDS As DataSet = ds.Clone() Dim r As DataRow Dim MyRows As DataRow() = ds.Tables("Test").Select("Country = '" & sParam & "'")
For Each r In MyRows newDS.Tables("Test").ImportRow(r) Next End Sub
|
|
|