Solved

Populating Combo Box

Posted on 2003-11-27
23
453 Views
Last Modified: 2010-04-09
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
Comment
Question by:pranabdhar
  • 9
  • 4
  • 3
  • +5
23 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 9830740
Sorry - what is "2 lakh records"
0
 
LVL 5

Expert Comment

by:apparition
ID: 9832340
I think he means 200 thousand records.
0
 
LVL 5

Expert Comment

by:apparition
ID: 9832368
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 31

Expert Comment

by:seanpowell
ID: 9832407
>>200 thousand records.
Are you serious?
0
 
LVL 5

Expert Comment

by:apparition
ID: 9832464
yap 1 lakh = 100 thousand

lakh is an indian word meaning 100 thousand
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9832494
listening....

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

Cd&
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9832517
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
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9834374
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
 
LVL 11

Expert Comment

by:Zontar
ID: 9836970
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9842488
I want to see the user willing to scroll through the select to find the option they want.

Cd&
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9842500
Hey, I finally found it! That was worth the 1 1/2 hours.

Drat - hit the reload key by mistake.
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 9876728
Maybe if you use a really really small font, it would load faster.   ;-D
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10801283
delete IMHO... but it was good for a chuckle.

Cd&
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 10801290
Hence PAQ'ing it... Also for the definition of a Lahk :)
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10801332
Someone really should be posting Cd& an easy 500 pointer right about now - just to throw him over the top :-)
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10801336
Actually 254 would just about do it.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 10801341
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10801345
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
 
LVL 31

Expert Comment

by:seanpowell
ID: 10801346
Drats....

Hey That's not allowed :-)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10801800
Definitely worth PAQing now as evidence of a conspiricy.  <G>

Cd&
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10801924
ROFL - I concur :-)
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10967244
PAQed - no points refunded (of 125)

modulo
Community Support Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP:Radiobuttonlist/asp:RadioButtonListItem custom styling 1 42
Safari On Gmail only html 12 56
HTML - Color not displaying correctly in EMAIL. 6 38
div to fit another div 8 23
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

810 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