?
Solved

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

Posted on 2007-04-10
1
Medium Priority
?
1,303 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

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

764 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