473,390 Members | 1,521 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,390 software developers and data experts.

what is best practice to populate large combobox?

Hello,

I have a search application to search data in tables in a database (3 sql
server tables). I populate 2 comboboxes with with data from each table. One
combobox will contain unique CompanyID's. The second combobox will contain
unique memberID's. Each of the tables that I have to search contain a
CompanyID and a memberID field, and these fields are not unique in the
respective tables. Like

CompanyID, MemberID
Clorox Smith

can exist several times in a table. Each table contains hundreds of
thousands to millions of rows.

Right now I use a dataAdapter to fill a dataTable (for each combobox) with
unique/distinct CompanyID and fill a combobox with unique/distinctMemberID
data for each table to be searched. Then I base the combo1.Datasource =
dataTable1.... When I switch tables, I was having to repopulate the
datasource tables for each combobox. Each combobox will contain around
40,000 unique ID's per table to be searched. This was taking way too long.
So then I thought since I have to search 3 Tables (each contains CompanyID
and MemberID fields), I would populate 6 dataTables when the application
first opens up. Then I could switch the datasource of each combobox as
needed. Ths was still taking a while. So my last effort was to have 6
individual comboboxes (placed on top of each other) populate them all at the
opening of the application and make them visible only according to the table
being searched at the time. But now I have all this data in memory.

If memory isn't an issue (like each workstation that would use this search
app would contain 2 gigs of memory a piece) would loading up 6 comboboxes
with 40,000 items apiece all at once be a reasonable practice? Or if there
is a better/more correct way to do this - could someone tell me what this way
is?

Thanks,
Rich
Jul 5 '06 #1
5 5872
What is the likelyhood that someone will try to scroll through your 40,000
items in the combobox? Is it possible to replace the combobox with a search
algorhythm whereby the user enters the desired search criteria in a dialog
box and only bring up the filtered results. Alternatively, you can use a
text box and then fill the suggested items after they have entered a number
of characters, returning a filtered list at that point. Having a user wade
through 40,000 records is unrealistic from their standpoint and a performance
hog from yours. Even if they have enough ram to hold the records, think about
the required network bandwidth to transfer that many records.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
Hello,

I have a search application to search data in tables in a database (3
sql server tables). I populate 2 comboboxes with with data from each
table. One combobox will contain unique CompanyID's. The second
combobox will contain unique memberID's. Each of the tables that I
have to search contain a CompanyID and a memberID field, and these
fields are not unique in the respective tables. Like

CompanyID, MemberID
Clorox Smith
can exist several times in a table. Each table contains hundreds of
thousands to millions of rows.

Right now I use a dataAdapter to fill a dataTable (for each combobox)
with unique/distinct CompanyID and fill a combobox with
unique/distinctMemberID data for each table to be searched. Then I
base the combo1.Datasource = dataTable1.... When I switch tables, I
was having to repopulate the datasource tables for each combobox.
Each combobox will contain around 40,000 unique ID's per table to be
searched. This was taking way too long. So then I thought since I
have to search 3 Tables (each contains CompanyID and MemberID fields),
I would populate 6 dataTables when the application first opens up.
Then I could switch the datasource of each combobox as needed. Ths
was still taking a while. So my last effort was to have 6 individual
comboboxes (placed on top of each other) populate them all at the
opening of the application and make them visible only according to the
table being searched at the time. But now I have all this data in
memory.

If memory isn't an issue (like each workstation that would use this
search app would contain 2 gigs of memory a piece) would loading up 6
comboboxes with 40,000 items apiece all at once be a reasonable
practice? Or if there is a better/more correct way to do this - could
someone tell me what this way is?

Thanks,
Rich

Jul 5 '06 #2
Hi Jim,

Thank you for your reply. In response to your questions, there are a
couple of hard core data processing people at my place. They know all 40,000
of the companies and members that my places deals with. The thing with the
combobox is that the data processing people can type in part of a name (ID)
in the combobox and the dropdown of the combobox will display a list of all
names that are close to what they typed in. This is pretty nice
functionality.

I have, in fact, considered your suggestion of typing in a few chars and
then autopopulating a dialog box with a filtered name. That would be the
most ideal. But would this be more realistic than than the combobox approach
against tables with hundreds of thousands of rows? If it is realistic, may I
request a simple example of how to implement something like this?

Select ID from tbl1 where ID Like '" & txtID.Text & "%'"

which would returns several rows which I could read with sqlDataReader and
further filter. Except I would have to run this for every keystroke in
textID. But if you think this is better than the combobox method, I would
certainly give it a shot.

Thanks,
Rich

"Jim Wooley" wrote:
What is the likelyhood that someone will try to scroll through your 40,000
items in the combobox? Is it possible to replace the combobox with a search
algorhythm whereby the user enters the desired search criteria in a dialog
box and only bring up the filtered results. Alternatively, you can use a
text box and then fill the suggested items after they have entered a number
of characters, returning a filtered list at that point. Having a user wade
through 40,000 records is unrealistic from their standpoint and a performance
hog from yours. Even if they have enough ram to hold the records, think about
the required network bandwidth to transfer that many records.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
Hello,

I have a search application to search data in tables in a database (3
sql server tables). I populate 2 comboboxes with with data from each
table. One combobox will contain unique CompanyID's. The second
combobox will contain unique memberID's. Each of the tables that I
have to search contain a CompanyID and a memberID field, and these
fields are not unique in the respective tables. Like

CompanyID, MemberID
Clorox Smith
can exist several times in a table. Each table contains hundreds of
thousands to millions of rows.

Right now I use a dataAdapter to fill a dataTable (for each combobox)
with unique/distinct CompanyID and fill a combobox with
unique/distinctMemberID data for each table to be searched. Then I
base the combo1.Datasource = dataTable1.... When I switch tables, I
was having to repopulate the datasource tables for each combobox.
Each combobox will contain around 40,000 unique ID's per table to be
searched. This was taking way too long. So then I thought since I
have to search 3 Tables (each contains CompanyID and MemberID fields),
I would populate 6 dataTables when the application first opens up.
Then I could switch the datasource of each combobox as needed. Ths
was still taking a while. So my last effort was to have 6 individual
comboboxes (placed on top of each other) populate them all at the
opening of the application and make them visible only according to the
table being searched at the time. But now I have all this data in
memory.

If memory isn't an issue (like each workstation that would use this
search app would contain 2 gigs of memory a piece) would loading up 6
comboboxes with 40,000 items apiece all at once be a reasonable
practice? Or if there is a better/more correct way to do this - could
someone tell me what this way is?

Thanks,
Rich


Jul 5 '06 #3
If you are using 2.0, look at the AutoCompleteSource property of the ComboBox
and TextBox. You can fill it when X number of characters have been typed
and not re-query unless the first x characters are changed.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
Hi Jim,

Thank you for your reply. In response to your questions, there are a
couple of hard core data processing people at my place. They know all
40,000 of the companies and members that my places deals with. The
thing with the combobox is that the data processing people can type in
part of a name (ID) in the combobox and the dropdown of the combobox
will display a list of all names that are close to what they typed in.
This is pretty nice functionality.

I have, in fact, considered your suggestion of typing in a few chars
and then autopopulating a dialog box with a filtered name. That
would be the most ideal. But would this be more realistic than than
the combobox approach against tables with hundreds of thousands of
rows? If it is realistic, may I request a simple example of how to
implement something like this?

Select ID from tbl1 where ID Like '" & txtID.Text & "%'"

which would returns several rows which I could read with sqlDataReader
and further filter. Except I would have to run this for every
keystroke in textID. But if you think this is better than the
combobox method, I would certainly give it a shot.

Thanks,
Rich

Jul 5 '06 #4
Thanks. The autocomplete property is what I was missing. Yes, I have .Net
2.0. this is nice. Now I have something.

Thanks for your help.

Rich

"Jim Wooley" wrote:
If you are using 2.0, look at the AutoCompleteSource property of the ComboBox
and TextBox. You can fill it when X number of characters have been typed
and not re-query unless the first x characters are changed.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
Hi Jim,

Thank you for your reply. In response to your questions, there are a
couple of hard core data processing people at my place. They know all
40,000 of the companies and members that my places deals with. The
thing with the combobox is that the data processing people can type in
part of a name (ID) in the combobox and the dropdown of the combobox
will display a list of all names that are close to what they typed in.
This is pretty nice functionality.

I have, in fact, considered your suggestion of typing in a few chars
and then autopopulating a dialog box with a filtered name. That
would be the most ideal. But would this be more realistic than than
the combobox approach against tables with hundreds of thousands of
rows? If it is realistic, may I request a simple example of how to
implement something like this?

Select ID from tbl1 where ID Like '" & txtID.Text & "%'"

which would returns several rows which I could read with sqlDataReader
and further filter. Except I would have to run this for every
keystroke in textID. But if you think this is better than the
combobox method, I would certainly give it a shot.

Thanks,
Rich


Jul 5 '06 #5
I have a similiara situation and I use a treevew control with the first level
being the letters if the alphabet and a folder icon. When the user clicks on
a folder, I load that node with sub nodes from all members starting with the
leter on the folder. This way, I only have to populate those nodes that the
user is interested in. Much quicker.
--
Dennis in Houston
"Rich" wrote:
Thanks. The autocomplete property is what I was missing. Yes, I have .Net
2.0. this is nice. Now I have something.

Thanks for your help.

Rich

"Jim Wooley" wrote:
If you are using 2.0, look at the AutoCompleteSource property of the ComboBox
and TextBox. You can fill it when X number of characters have been typed
and not re-query unless the first x characters are changed.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
Hi Jim,
>
Thank you for your reply. In response to your questions, there are a
couple of hard core data processing people at my place. They know all
40,000 of the companies and members that my places deals with. The
thing with the combobox is that the data processing people can type in
part of a name (ID) in the combobox and the dropdown of the combobox
will display a list of all names that are close to what they typed in.
This is pretty nice functionality.
>
I have, in fact, considered your suggestion of typing in a few chars
and then autopopulating a dialog box with a filtered name. That
would be the most ideal. But would this be more realistic than than
the combobox approach against tables with hundreds of thousands of
rows? If it is realistic, may I request a simple example of how to
implement something like this?
>
Select ID from tbl1 where ID Like '" & txtID.Text & "%'"
>
which would returns several rows which I could read with sqlDataReader
and further filter. Except I would have to run this for every
keystroke in textID. But if you think this is better than the
combobox method, I would certainly give it a shot.
>
Thanks,
Rich
Jul 6 '06 #6

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

Similar topics

0
by: Ryan Liu | last post by:
I think there are two way to define user control. For example, I want to define a ComoBox with contains only AM, PM items. a.. One way I define a class extends...
1
by: Bill W. | last post by:
I have three text fields, A, B, C on a form. I want to be able to select data from a combo-box (or list-box) and then populate those three fields based on what was selected. Any code-snippets...
4
by: godber | last post by:
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be...
26
by: Lasse Edsvik | last post by:
Hello I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager..... what more is needed than this: using System; using...
4
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be...
0
by: masterej | last post by:
I'm trying to populate a ComboBox (dropdown style) with strings of text from an ArrayList. The ComboBox is actually being populated with the correct items, however, they appear only as blank...
16
by: agrawal.solutions | last post by:
Hello Friends I am asking a very silly question but i dont find any solution fo this.. I am selectiong a recordset and want to populate a combobox where id would be inviseble and the content...
2
by: rperreta | last post by:
I exported a xml file using .writexml from a dataset and now I would like to populate a combo box from that. Can someone supply a link or sample vb.net code that show's how to do this... much...
0
TonFrere
by: TonFrere | last post by:
Hello, I'm building a windows form application in Visual C# using VS 2005. On my form I need to populate a combobox with Invoices# linked to the current reccord's Order# value. This means that: -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.