Load data into combobox control asynchronously

G

Guest

Hi,

I am having a problem with my form being too slow to load up. I have a 4-5
of comboboxes on the form that load a lot (~30,000 records) into them. So
this is causing a lot delay (5-6 seconds) for the form to load. Most of the
time the form will be used for viewing data only. But sometimes the data can
be edited. I am trying to reduce the startup time of the form when the clicks
to load it. I was wondering if i could load the data in the comboboxes in the
background asynchronously. I am getting the data to be loaded in a DataReader
from a stored procdure. Does any one have any suggestions on how best this
can be accomplised. Any and all ideas will be greatly appreciated.

Thank you,
Vish
 
W

William Stacey [MVP]

http://spaces.msn.com/staceyw/blog/cns!F4A38E96E598161E!652.entry This is
an easy method.

--
William Stacey [MVP]

| Hi,
|
| I am having a problem with my form being too slow to load up. I have a 4-5
| of comboboxes on the form that load a lot (~30,000 records) into them. So
| this is causing a lot delay (5-6 seconds) for the form to load. Most of
the
| time the form will be used for viewing data only. But sometimes the data
can
| be edited. I am trying to reduce the startup time of the form when the
clicks
| to load it. I was wondering if i could load the data in the comboboxes in
the
| background asynchronously. I am getting the data to be loaded in a
DataReader
| from a stored procdure. Does any one have any suggestions on how best this
| can be accomplised. Any and all ideas will be greatly appreciated.
|
| Thank you,
| Vish
 
G

Guest

Hi Justin,

I did try using the BackgroundWorker for loading the data but it did not
work out for me. The way i approached it was to start the BackgroundWorker
component to start loading when the form object was created in its
constructor. But this does not solve the problem, when the user clicks on the
combobox right after the form appears the combobox is empty and stays empty.
Is there any way that the combobox can be slowly loaded without delaying the
form from showing up. Also the combobox datasource is set to the results from
a stored procedure.

Is there a technique to aynchronously load the data into the combobox as and
when the data comes in?

Thank You,
Vish
 
G

Guest

Hi Stacey,

I am trying to asynchronously bind results from executing a stored procedure
to the comboboxes i have on my form. I tried executing the Stored procedure
and setting the datasource in a different backgroundworker thread, but that
did not solve my problem as i explained in my other post. Any other ideas and
suggestions would be greatly appreciated.

Thank You,
Vish
 

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