Query a Dataset

  • Thread starter Thread starter brian
  • Start date Start date
B

brian

If I create a dataset called "Test" can I run SQL code
against that dataset? If so How?

Can a dataset be cached? If so how would you run a query
on that?

The reason I am asking is because currently I am opening
and closing a datareader for 3 functions where I could
just bring all the data into dataset and only need to
read from the DB once.

Please Advise!

Thanks
 
Yes you can query against a dataset.

dim ds as dataset = myMethodReturningADataset()
dim dv as dataview = ds.Tables(0).DefaultView
dv.RowFilter="FirstColumn='Fred'" 'use the where clause style here

And yes you can cache a dataset.

-Stanley
 
Back
Top