473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Load data into combobox control asynchronously

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
4 10215
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Trent | last post by:
I am in the design phase of a new database and am having a devil of a time with a subform. I have three tables that relate to problem - Suppliers tbl, Customers tbl and a SuppliersCustomers tbl....
0
by: Anthony | last post by:
is there a way to stop combox from firing SelectedIndexChanged events on loading when it is databinded? everytime my form loads, SelectedIndexChanged fires 4 times? using System; using...
9
by: Li Pang | last post by:
I use a combobox control to populate the data. I want to prevent to change data (freeze the data in the filed). The only solution I have is to set Enabled property to "False", but it gray out the...
4
by: Kalvin | last post by:
I have seen this question raised, but I cannot find an answer. I have an MDI app, when I load an child form with a combobox being bound in the load event, it won't allow me to set selectedindex =...
2
by: Don | last post by:
I've looked high and low for some code that will allow me to have a combobox with a flat borderstyle. I found a few examples, but nothing that was really usable for me. I had the following...
3
by: Ronald S. Cook | last post by:
In my Win app, I'm needing to load a media file into my Windows Media Player control, and THEN read an attribute from the file. The thing is, the file has to be playing for a split second before...
4
savanm
by: savanm | last post by:
Hi all, I have one doubt. How to load data from the databse in to combobox.. I have a mysql table login two fields in the table namely user and password I want to load the list of user's...
9
by: Denis | last post by:
Hello, Maybe somebody already solved this task. I need to load JS asynchronously without blocking browser. This means that I do not need to block browser to load/render during loading script. The...
9
by: Greg (codepug | last post by:
I have a combobox with the RowSourceType set to Table/Query and the RowSource is an SQL query that references a separate lookup table that contains the data that can be selected in the combobox....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.