Newbie: Dataset - SQL selection

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

Hi,
I was wondering if there is a way/command to do the following:

I have a dataset that is filled with a few tables and the tables are related
together (dataset.relations.add(...)).

Now, I want to populate a listview with specific data. I mean, is it
possible to execute a SELECT statement *on the dataset* with the data that
it already contains? Without going through the actuall database and
dataadapter?

Basically i want to filter the data.

Maybe it would be better for me to loop through the data. Is there a way to
loop through a table or tables in a dataset and store *specific* fields in
e.g. multidimensional array?

TIA
 
You can use something like the following

Dim dv As New DataView(DataSet.Tables[0]) <------This will
apply the filter on the first table in the dataset
dv.RowFilter = "name = 'steve'" <-------- Replace this with your
condition

At this stage you can bind a control with the dataview, and the control
will display only the rows that satisfy the RowFilter condition.

Cheers,
John Wadie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top