Fastest way to Populate a DropDown List

  • Thread starter Thread starter @tley
  • Start date Start date
@

@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.

@
 
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
 
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
 
Back
Top