Lazy filling a large dataset

G

Guest

hi

is it possible to fill a dataset such that it can be done in increments?
for instance, if I have a large table with a big schema (like 50 columns -
for whatever reason), could I fill a dataset table with a partial query like
(via a dataadapter

SELECT key_value, name, address, phone, zip FROM bigtable

to display in a grid, then when wants details, use a different command on
the same adapter like so

SELECT * FROM bigtable WHERE (key_value = ?)

and have it fill in the rest of the record.

The first time, the missing fields are null (I've done this and it works).
If I attach the second select command and do a
"myDataAdapter.Fill(aDataSet), it goes into a dead run doing something.
Seems like I should be able to select new records into the dataset by
tactical select statements without a whole lot of overhead. If this were
true, then I could test a record value to see if its been loaded, and kind
of do a lazy init of the dataset. However, I'm also curious what would
happen on an update. Probably better off have two instances of the same
type dataset, one with short query and one with the full.

what do you think?

Bill
 
W

W.G. Ryan eMVP

If you're using Sql Server you can append the querys and run them in batch -
or you can just fill the datasets in increments using different commands.
Either way you'll get there.
 

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

Top