Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-04-10
1
Medium Priority
?
1,310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
_TAD_ earned 1500 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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 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 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 …

618 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