[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 463
  • Last Modified:

Populating Combo Box

Hello...

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...
0
pranabdhar
Asked:
pranabdhar
  • 9
  • 4
  • 3
  • +5
1 Solution
 
seanpowellCommented:
Sorry - what is "2 lakh records"
0
 
apparitionCommented:
I think he means 200 thousand records.
0
 
apparitionCommented:
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
seanpowellCommented:
>>200 thousand records.
Are you serious?
0
 
apparitionCommented:
yap 1 lakh = 100 thousand

lakh is an indian word meaning 100 thousand
0
 
COBOLdinosaurCommented:
listening....

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

Cd&
0
 
seanpowellCommented:
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 :-)
0
 
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">

<html>
<head>
      <title>Untitled</title>
</head>

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

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?
0
 
ZontarCommented:
I did the same thing in PHP with a simple loop, no DB, just a straight counter:

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

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???
0
 
COBOLdinosaurCommented:
I want to see the user willing to scroll through the select to find the option they want.

Cd&
0
 
seanpowellCommented:
Hey, I finally found it! That was worth the 1 1/2 hours.

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

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

http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20950340.html
0
 
seanpowellCommented:
Drats....

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

Cd&
0
 
seanpowellCommented:
ROFL - I concur :-)
0
 
moduloCommented:
PAQed - no points refunded (of 125)

modulo
Community Support Moderator
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 9
  • 4
  • 3
  • +5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now