dataset usage

  • Thread starter Thread starter david
  • Start date Start date
D

david

i am tring to generate a single dataset which contains
all records from a table and then create subsets of this
dataset which can fill certail controls and i am not sure
of the best method eg. dataview, select etc.

can someone help..
 
There are a lot of different possibilities here and without more info, it is
hard to give a good answer. But I will try to give a couple of
recommendations.

First, I would ask why you are generating a dataset with all of your table
data. Is all of this data used on the page? If not, I would shrink the
dataset to just what is needed - reading the database just isn't that costly
unless the queries are extremely nasty.

Second, I would apply a DataView to the DataTable to get the subset of
records you are interested in. A DataView does not take a copy of the
data - rather it is just an alternate way to view the data in the DataTable.
So DataViews are lightweight. And in my experience, they are pretty fast
although I would suspect they would slow down if the DataTable is large.
You can also bind controls to DataViews.

Jeff
 
Back
Top