473,394 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to handle a large drop-down list?

Hi - I'm developing a 'front-desk' app. to be used over the internet.
(SQL-Server back-end).

One of the pages will require the user to select an entry from a large
(~4000) list of 'member names'.

What are the options to reduce the bandwidth load of this? Is there any way
that I can cache the list on the client (and allow them to periodically
'refresh' their local copy?). Or, does anyone have some code for a 'manual'
auto-select option where the user can enter the start of the name (eg.
"Wri") into a textbox and the list will be populated with all matching
names?

The list will be called upon many times a day and is relatively static (~1-2
changes a day).

Thanks for any and all suggestions,

Paul.
Nov 19 '05 #1
3 11108
First off, please, under any circumstances, populate a dropdown list with
4000 items. This will be completely useless to the end user.

One way you can cache something like this, is to put the items in a list in
a javascript file. So store it in an array, whatever. Include the js file in
your .aspx, and pull the list from there. The beauty of js files, is that
every time you open a new browser instance and browse to the page, the
browser checks for a newer version of the js file. Of course, there is no
way to force the client to get a newer file other then having them do what I
described.

This would mean, that you probably will need to manually maintain this js
file, or have a process that knows how to reconstruct it based on what is in
SQL server periodically. Maybe whatever lets you add members, would then
make sure this file is updated as well.

The filtering you want, is not something going to happen on its own. You
will need to write javascript that will be able to search through the list
of people and filter it, and change the contents of the dropdown. Depending
on how you are storing this data on the client, this can potentially cause a
noticeable delay.

I would recommend having a dialog lookup, which allows a user to filter/do a
search on member, select a member. Selecting a member would close the dialog
and populate the field value on the main page with the selection.

"Paul W" <qq*@qqq.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi - I'm developing a 'front-desk' app. to be used over the internet.
(SQL-Server back-end).

One of the pages will require the user to select an entry from a large
(~4000) list of 'member names'.

What are the options to reduce the bandwidth load of this? Is there any
way that I can cache the list on the client (and allow them to
periodically 'refresh' their local copy?). Or, does anyone have some code
for a 'manual' auto-select option where the user can enter the start of
the name (eg. "Wri") into a textbox and the list will be populated with
all matching names?

The list will be called upon many times a day and is relatively static
(~1-2 changes a day).

Thanks for any and all suggestions,

Paul.

Nov 19 '05 #2
If the items in SQL server keep on adding or chaning, for eg 4000 can
become 5000 and so on, then I would suggest to save the data in cache
and reterive it from cache.
When the page loads, you can get this data from SQL server and
reterive it in a DataSet. Then you can save this dataset in cache. You
can set the time of the cache for 10 minutes or 20 minutes. Whenever
the cache is empty, the page will try to get data from SQL server and
will referesh the dataset with new data. Hope that makes sense..here is
the eg:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
If Not (IsPostBack) Then
BuildTable()
End If
End Sub

Private Sub BuildTable()
Dim myCacheData As New DataSet()
myCacheData = GetCacheData()
myDropDownList.DataSource = myCacheData.Tables(0)
myDropDownList.DataTextField = "Column1 '
myDropDownList.DataValueField = "Column2
myDropDownList.DataBind()
End Sub

Private Function GetCacheData() As DataSet
Dim blnResults As Boolean

Dim ds As DataSet = CType(Cache.Get("CodeList "), DataSet)
If ds Is Nothing Then
ds= New DataSet()
'Fill the dataset. Below is the ex from my code..
'blnResults = myServices.GetCode(ds)' In this line
basically fill ur ds with 4000 records from SQl server
If blnResults = True Then
Cache.Insert("CodeList", ds, Nothing,
DateTime.Now.AddMinutes(10), TimeSpan.Zero)
End If
End If
GetCacheData = ds
End Function

Nov 19 '05 #3
Also consider;

+ Making your list hierarchical and using a treeview. More manageable, and
with some work you can make the data load on expansion of a node. More
round trips, but a lot less data per trip. Of course, your data has to be
hierarchically organizable, e.g. by member classification, when they joined,
by location, or some other criteria that is intuitive and useful.

+ Using filters. Marina's partial-text match is a good example; but for
'member names' an A-Z bar could also provide advantages.
"Marina" <so*****@nospam.com> wrote in message
news:u$**************@TK2MSFTNGP14.phx.gbl...
First off, please, under any circumstances, populate a dropdown list with
4000 items. This will be completely useless to the end user.

One way you can cache something like this, is to put the items in a list in a javascript file. So store it in an array, whatever. Include the js file in your .aspx, and pull the list from there. The beauty of js files, is that
every time you open a new browser instance and browse to the page, the
browser checks for a newer version of the js file. Of course, there is no
way to force the client to get a newer file other then having them do what I described.

This would mean, that you probably will need to manually maintain this js
file, or have a process that knows how to reconstruct it based on what is in SQL server periodically. Maybe whatever lets you add members, would then
make sure this file is updated as well.

The filtering you want, is not something going to happen on its own. You
will need to write javascript that will be able to search through the list
of people and filter it, and change the contents of the dropdown. Depending on how you are storing this data on the client, this can potentially cause a noticeable delay.

I would recommend having a dialog lookup, which allows a user to filter/do a search on member, select a member. Selecting a member would close the dialog and populate the field value on the main page with the selection.

"Paul W" <qq*@qqq.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Hi - I'm developing a 'front-desk' app. to be used over the internet.
(SQL-Server back-end).

One of the pages will require the user to select an entry from a large
(~4000) list of 'member names'.

What are the options to reduce the bandwidth load of this? Is there any
way that I can cache the list on the client (and allow them to
periodically 'refresh' their local copy?). Or, does anyone have some code for a 'manual' auto-select option where the user can enter the start of
the name (eg. "Wri") into a textbox and the list will be populated with
all matching names?

The list will be called upon many times a day and is relatively static
(~1-2 changes a day).

Thanks for any and all suggestions,

Paul.


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jeff brubaker | last post by:
Hello, Currently we have a database, and it is our desire for it to be able to store millions of records. The data in the table can be divided up by client, and it stores nothing but about 7...
2
by: JollyK | last post by:
Hello friends, In a large asp.net project, I don't think it is a good idea for having one common resource file containing all localized strings for the whole application. I think a better...
2
by: Alan Silver | last post by:
Hello, I am writing a page that allows the user to upload two images to the server. I have two HTMLInputFile controls on the page ... <input id="smallimage" Type="File" Runat="Server">...
11
by: Greg Smalter | last post by:
I'm converting some ASP web projects from VS 2003 to VS2005/ASP 2.0. The worst problem I've run into is all references (in codebehind CS files) to UserControls fail. I get the error "The type...
6
by: Eric Chomko | last post by:
I inherited a task which uses a lot of 'ostrstream' in the code. The port is from an SGI box to Sun which is using GNU C++ (g++ version 3.4.2). When trying to compile I get several errors all...
1
by: Dragon | last post by:
Is there any examples of Drag and Drop how to handle in C# ?
10
by: Miro | last post by:
I wanted certain text boxes ( only certain ones ) to always be Trim'd so that spaces are not in the begining, nor the end of the text entered. I created my own "Handle ?" - i hope thats the...
6
by: Kai Zhu | last post by:
I wrote a piece of code to handle drag and drop of DIV element. The code works fine in firefox, but has some problem will IE. We I load the HTML, I can not drag the DIV, and IE seems to be not...
2
by: daniel | last post by:
I have the following scenario. A mysql database running 3 databases. It is version 5.0.27 on Windows XP Prof.. All innodb databases. The one database is particularly large (7.8GB of...
0
by: eduardasm | last post by:
Hello, I have a problem with XML schema update for one XML column (problem exists in both SP1 and SP2 for SQL Server 2005). 1. I have a table that looks like this: CREATE TABLE .( NOT NULL...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.