Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

Is it possible to load only the file data of the current record into a dataset + the data of the combo boxes like postal codes, etc., and this to save memory space and to speedup loading a dataset.

 

An article form contains in our case about 60 fields, of which also about 10 combo boxes with their underlying data (postal codes = about 2000 codes + town names, article subgroubs about 50 codes, ...). The article file contains about 2000 articles with 60 fields.

 

Our purpose is to only load the data of the current record, edit the record, and then move to the next record which we load at this very moment. The data of the combo boxes and list boxes we have to load on form_load. This all to save memory.

 

Another file with supplier catalogues contains 50.000 records. So here the memory is even more occupied.

 

Thanks.

  • *Experts*
Posted

I've done this before by having the SQL that selects the ID's also select the lookup value.

 

Suppose you have a combobox for AddressType. You main SQL query returns an AddressTypeID which you bind the combobox. You would normally then bind a lookup table of all AddressTypes to the combo. Instead, have the main query that returns AddressTypeID ALSO return AddressType (the description from the lookup table). When you go to setup your binding (or however you fill your combo), fill it with this one value.

 

You'll now have to figure out when the combo is first dropped down and populate it with all of the real values. You can wait til the combo is dropped down and then retrieve the values or you can load all the lookups asyncronously. When the lookups are finished loading asyncronously, fill the combos behind the scene.

 

Another solution that might work is to download all the lookups locally one time or include them as part of a setup. Assuming your lookups have some kind of date identifier to note when they've been added or updated, you can have the user download the new/changed lookup values when they first log into your app. This will still mean that you'll have all 50,000 records loaded into some combos, which might be slow even if reading from disk. In that case, you'll need to rethink how they select that value (maybe you don't use a combobox but some kind of search mechanism).

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...