Slow Form load/navigation with databinding

V

Vincent Dalton

All,

I have a table named "CONTACTS" with 104 records in it, a table named
"ZIP_CODES" with 42,471 records in it, and several other tables. I load
these records into a dataset, create the relationships, and then bind the
controls on the form to the dataset. The ZIP Codes are loaded into a
combobox. All the controls load quickly. However, It takes forever to load
the form, to move from record to record, or update a record.

If I remove the binding from the "ZIP_CODES" table, the problem is gone. The
form loads quickly, navigation is quick and deleting/updating is quick. This
defeats the purpose, though, as the record is no longer bound. Is there a
way that I can still have the ZIP codes databound to insure referential
integrity as well as speed up the form/dataset?

TIA,

Vince Dalton
 
L

luxspes

Vincent said:
All,

I have a table named "CONTACTS" with 104 records in it, a table named
"ZIP_CODES" with 42,471 records in it, and several other tables. I load
these records into a dataset, create the relationships, and then bind the
controls on the form to the dataset. The ZIP Codes are loaded into a
combobox.

You should only load the ZipCodes that are related to the contacts that
you are displaying in a particular moment.

All the controls load quickly. However, It takes forever to load
the form, to move from record to record, or update a record.

Of course, you have 42,471 binded to the UI...
If I remove the binding from the "ZIP_CODES" table, the problem is gone. The
form loads quickly, navigation is quick and deleting/updating is quick.

But still you are wasting a lot of RAM... and remember scalability
(imagine if you have 10 users for you system... and they all enter that
form... they will load 420,000 records... (and just imagine if you ever
had 100 users....) You shouldn't load anything into memory that you are
not going to use... (I certainly hope that you are not trying to show
the 42,000 rows in combobox... a user is hardly capable to
use/understand a combobox with more than 7 rows)

The main problem here... with the dataset... is that make it hard to
dynamically load exactly what you need... I was hoping that was going to
be "fixed" by objectspaces... but since it died (or mutated into WinFS)
for now... and acceptable option is http://www.nhibernate.org, that way
only the required ZipCodes for the particular Contacts that you load
will be loaded (and only if you ask for them)

This
 

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