Solved

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

Posted on 2007-04-10
1
1,294 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

713 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