Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox
Passing file to ComboBox Passing file to ComboBox
Passing file to ComboBox
Go Back  Xtreme Visual Basic Talk > > > Passing file to ComboBox


Reply
 
Thread Tools Display Modes
  #1  
Old 09-01-2009, 03:17 AM
Alchemist_Angel Alchemist_Angel is offline
Newcomer
 
Join Date: Sep 2009
Posts: 3
Default Passing file to ComboBox


Hello All,

I am new to VB environment. I am using Visual Studio 2005.

In certain code, I need to add 4000 elements to the ComboBox list.
Using the command
ComboBox1.Items.Add()
seems ridiculous.


I am thinking of creating EXCEL File, in which I will put all the names in 1 column and call that excel File, when "dropdown" of combo box is clicked.

Can Anybody tell me, how this will happen??
Any code related to this? or if this issue has already been discussed then plz give me the link for the same
Reply With Quote
  #2  
Old 09-01-2009, 05:46 AM
Cags's Avatar
CagsPassing file to ComboBox Cags is offline
Contributor

* Expert *
 
Join Date: Jul 2003
Location: Leicestershire, England
Posts: 710
Default

I've got to ask why you wish to add 4000 items to a single combobox? That seems an excessive amount of items to say the least, the user would take forever to find what they were looking for?
__________________
I don't suffer from insanity, I enjoy every minute of it.
http://www.tib-studios.co.uk
Reply With Quote
  #3  
Old 09-01-2009, 05:59 AM
Alchemist_Angel Alchemist_Angel is offline
Newcomer
 
Join Date: Sep 2009
Posts: 3
Default

Actually, I would be putting all the symbols of companies listed to stock market.

I agree, whatever you are saying is correct.

If you have some other solution please let me know.....I will go with that,

I am newbie to VB so might be wrong.
Reply With Quote
  #4  
Old 09-01-2009, 06:22 AM
Qua's Avatar
QuaPassing file to ComboBox Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

You can't expect people to browse through 4k items. Instead you should try to group the items within subcategories or allow the user to search through the items with specific criterias.

You could use a treeview to group related companies together, but it will properly be a huge amount of work from your side if you need to manually categorize the companies, so unless you got a set of predefined categories for your companies then I'd suggest that you build a search feature. You can make it as simple as letting the user type a word into a textbox after which you'll display a list of hits that's relevant to the search.
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
  #5  
Old 09-03-2009, 10:23 PM
Alchemist_Angel Alchemist_Angel is offline
Newcomer
 
Join Date: Sep 2009
Posts: 3
Default

Thank you for replies.

Definitely.......I am searching for an alternative to this.

I am thinking of one as you said but dont know this will work with VB or not......plz let me know.....

the search engine will work with the combo box.....

for ex....if user types........DLF........and the same name exists in database.........it will directly move to another window...........but if instead someone types......DL or DF........the search engine will run and search for nearest possible words present in the database. these names will then be displayed to user.

Is this possible in VB? If yes.....any hint??
Reply With Quote
  #6  
Old 09-03-2009, 11:22 PM
Qua's Avatar
QuaPassing file to ComboBox Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

Yes, it is possible. There are numerous ways to solve the problem at hand ranging from very basic (but also slow) to more complex but faster solutions.

You mention using a database and depending on the amounts of companies this sounds like a good solution. If you have a table containing all the company names you could do simple SQL queries on the table to retrieve what the user searched for. For example, if the user typed in "DL" into the search field, then a basic query using wildcards could look like this
Code:
SELECT CompanyName From Companies Where CompanyName LIKE '%DL%'
The query would find company names that had DL in them like "Business DL Company", "REDLOAD INC." and "DLF".
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox Passing file to ComboBox
Passing file to ComboBox
Passing file to ComboBox
 
Passing file to ComboBox
Passing file to ComboBox
 
-->