Solved

VB.Net - Loading large amounts of data into a combobox.

Posted on 2007-04-10
1
1,288 Views
Last Modified: 2008-01-09
Hello,
I have a VB.Net application in which I have several comboboxes on a form that contain a large about of data, about 13,000 rows each.  The query which retrieves the data is very fast.  Here is an example of my code that populates  8 combo boxes.
 
dsDxs = cCSharedFunction.getDx()
dsDX1 = dsDxs.Copy()
dsDX2 = dsDxs.Copy()
dsDX3 = dsDxs.Copy()
dsDX4 = dsDxs.Copy()

With UcDx1.cmbDX1
            .DataSource = dsDX1.Tables(0)
            .DisplayMember = "Dx"
            .ValueMember = "Description"
End With

With UcDx1.cmbDX1Desc
            .DataSource = dsDX1.Tables(0)
            .DisplayMember = "Description"
            .ValueMember = "Dx"
End With

With UcDx1.cmbDX2
            .DataSource = dsDX2.Tables(0)
            .DisplayMember = "Dx"
            .ValueMember = "Description"
End With

With UcDx1.cmbDX2Desc
            .DataSource = dsDX2.Tables(0)
            .DisplayMember = "Description"
            .ValueMember = "Dx"
End With

With UcDx1.cmbDX3
            .DataSource = dsDX3.Tables(0)
            .DisplayMember = "Dx"
            .ValueMember = "Description"
End With

With UcDx1.cmbDX3Desc
            .DataSource = dsDX3.Tables(0)
            .DisplayMember = "Description"
            .ValueMember = "Dx"
End With

With UcDx1.cmbDX4
            .DataSource = dsDX4.Tables(0)
            .DisplayMember = "Dx"
            .ValueMember = "Description"
End With

With UcDx1.cmbDX4Desc
            .DataSource = dsDX4.Tables(0)
            .DisplayMember = "Description"
            .ValueMember = "Dx"
End With

Any help to speed up the load of these controls would be greatly appreciated.

Thanks in advance.
0
Comment
Question by:mocaiv
1 Comment
 
LVL 22

Accepted Solution

by:
_TAD_ earned 500 total points
ID: 18883210

13,000 rows in a combo box?  That just doesn't sound like a good idea.  I mean, the whole idea behind a combo box is to allow someone to choose a value.  Choosing from 13,000 possible choices is just too much.

However, that being said, if you really want to improve performance you need to first look at your CPU usage and RAM usage.  If CPU is at 100% and RAM is swapping pages like crazy during this process, then there is nothing you can do.

On the other hand, if CPU and RAM are low throughout the loading process, then I would suggest multi-threading your application.

Create a delegate that will do the databinding for you.  That way you don't have to wait for each one to complete before starting the next one.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question