By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,978 Members | 1,362 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,978 IT Pros & Developers. It's quick & easy.

Load data into combobox control asynchronously

P: n/a
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
Mar 3 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi Vish, you should look into using the BackgroundWorker component, this will
let you perform these long tasks without freezing up your interface:

http://msdn2.microsoft.com/en-us/library/8xs8549b.aspx

Hope that helps!

"Vish" wrote:
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

Mar 4 '06 #2

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

--
William Stacey [MVP]

"Vish" <Vi**@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
| 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
Mar 4 '06 #3

P: n/a
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
"Justin Swan (MSFT)" wrote:
Hi Vish, you should look into using the BackgroundWorker component, this will
let you perform these long tasks without freezing up your interface:

http://msdn2.microsoft.com/en-us/library/8xs8549b.aspx

Hope that helps!

"Vish" wrote:
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

Mar 5 '06 #4

P: n/a
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
"William Stacey [MVP]" wrote:
http://spaces.msn.com/staceyw/blog/cns!F4A38E96E598161E!652.entry This is
an easy method.

--
William Stacey [MVP]

"Vish" <Vi**@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
| 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

Mar 6 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.