Fastest way to Populate a DropDown List

@

@tley

I am trying to find a very fast way to populate a dropdown list from a
SQLServerCE database on an iPaq...

The list source is fairly large (about 2500 entries) and I want to find the
most efficient way to populate this list, I have two of them with different
data and it currently takes about 35-40 seconds.

Any suggestions woudl be greatly appreciated.

@
 
H

Hector Obregon [eMVP]

Do you really need 2,500 entries on that list? Will it be usable?

If there is really no other way to design that UI, I would:

1. If databinding is not needed, iterate through a DataReader and fill that
list.
2. Or try databinding with a DataSet (most likely much slower)

Also you might want to first cache that on a background thread to speed up
the presentation time. The best way to approach performance decisions IMHO
is to try alternatives out and measure the elapsed times.

Cheers,

Hector
 
C

chris-s

As Hector has pointed out, is a drop down list with 2500 entries really
practical?

The fastest way is usually to NOT use databinding. Use a datareader and
loop thru the datarows manually adding them to the items.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top