Populating Combo Box


I have an asp page with a combo box...I want to populate the combo box with the value of a field from a sql table . But the table has 2 lakh records..and when I try to populate the combo box ..the records are not populating the combo box..but it populating when i m using a few thousand records...

Pls let me know how i can populate the combo box with more than 2 lakh records...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sorry - what is "2 lakh records"
I think he means 200 thousand records.
You should re-think the way you are trying to do this, loading 200 thousand records in a combobox is bad UI practice
and apart from it not working properly it can also be very annoying for the user. If you explain in detail what it is you are
actually trying to do maybe we can come think of an alternative.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

>>200 thousand records.
Are you serious?
yap 1 lakh = 100 thousand

lakh is an indian word meaning 100 thousand

This looks like fun.  and let's get load time in 3 seconds.  ;^)

That's almost the complete Oxford English Dictionary - do you need any special styling on that or is plain text sufficient?

Also, are you using a ComboBox or a Select Box - these are two different things.

Maybe you could post the records here and we'll have a look :-)
James RodgersWeb Applications DeveloperCommented:
just out of curiosity, mainly to check the size limit on a select(thought it would bum out at 32767 items) i ran the following in coldfusion

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


<cfquery name="junkSQL" datasource="xxx" password="xxx" username="xxx">
SELECT ltrim(rtrim(EmpId)) as Empid, CourseId
<select name="pureJunk">
<cfloop query="junkSQL">
<option value="#empid#">#empid#</option></cfloop>
<input type="button" onClick="alert(pureJunk.options.length)">

with the following results

table contains 106910 records
compile time a little over 2 minutes (surprised it didn't time out) and this was the only thing on the page!
number of records in the selectbox 106910 (again, surprised it could hold that many items)

pranabdhar, good luck you'll need it to get this to work in anything approaching a reasonable time and why in the world would you need a 200 k selectbox?
I did the same thing in PHP with a simple loop, no DB, just a straight counter:

  for($i = 1; $i <= 200000; $i++)
    echo "<option value=\"$i\">$i</option>\n";

Elapsed time: 25.337 seconds. This was *all* that was in the page, and it was run from the server sitting next to my desktop via a 100Mb LAN. MSIE chewed up 94 MB of memory and pegged my CPU at 100% the whole time while rendering it.

People will not be thanking you for throwing something like this at them.

WTF would you need 200,000 choices in a single select for, anyway???
I want to see the user willing to scroll through the select to find the option they want.

Hey, I finally found it! That was worth the 1 1/2 hours.

Drat - hit the reload key by mistake.
Maybe if you use a really really small font, it would load faster.   ;-D
delete IMHO... but it was good for a chuckle.

Michel PlungjanIT ExpertCommented:
Hence PAQ'ing it... Also for the definition of a Lahk :)
Someone really should be posting Cd& an easy 500 pointer right about now - just to throw him over the top :-)
Actually 254 would just about do it.
Michel PlungjanIT ExpertCommented:
There you go - I was only a day away from asking it anyways...


Hey That's not allowed :-)
Definitely worth PAQing now as evidence of a conspiricy.  <G>

ROFL - I concur :-)
PAQed - no points refunded (of 125)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.