473,326 Members | 2,012 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,326 software developers and data experts.

Which collection class to use?

I'm working on a VB.Net app that has State class (CA, AZ, WA...) and
collection class of State.
Which collection class interface can I use if want to be able to bind the
collection a combo box and at the same time be able to reference the item in
the collection by key?
I know that combo box data source must be an IList but with IList I can't
reference the object with the key.
Can this be done in VB.Net?

Thanks for any ideas,
Cesar
Jul 21 '05 #1
2 1504
Cesar-

You will want to use the SortedList collection since this allows each item
to have a key for each item.

Hope that helps,
Marc Butenko
mb******@bresnan.net

"cksj" <ck*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm working on a VB.Net app that has State class (CA, AZ, WA...) and
collection class of State.
Which collection class interface can I use if want to be able to bind the
collection a combo box and at the same time be able to reference the item in the collection by key?
I know that combo box data source must be an IList but with IList I can't
reference the object with the key.
Can this be done in VB.Net?

Thanks for any ideas,
Cesar

Jul 21 '05 #2
Cesar-

You will want to use the SortedList collection since this allows each item
to have a key for each item.

Hope that helps,
Marc Butenko
mb******@bresnan.net

"cksj" <ck*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I'm working on a VB.Net app that has State class (CA, AZ, WA...) and
collection class of State.
Which collection class interface can I use if want to be able to bind the
collection a combo box and at the same time be able to reference the item in the collection by key?
I know that combo box data source must be an IList but with IList I can't
reference the object with the key.
Can this be done in VB.Net?

Thanks for any ideas,
Cesar

Jul 21 '05 #3

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

Similar topics

1
by: sayoyo | last post by:
Hi Guys, I have to implement a design in Java which is a collection class gathers several units of the same class. I was thinking about two ways to implement it. the first is to create two...
4
by: Saso Zagoranski | last post by:
Hi! I need an array-type of collection when the entries would look like: object myObject, int myInt, string myString Which collection should I use? I know I could declare a multidimensional...
5
by: Oberon | last post by:
I want to create a collection of records which will be permanently available at the application level in an ASP.NET application. How should I go about that? Lets say that the record structure...
1
by: cksj | last post by:
I'm working on a VB.Net app that has State class (CA, AZ, WA...) and collection class of State. Which collection class interface can I use if want to be able to bind the collection a combo box and...
13
by: Scott Meddows | last post by:
I'm writing an NT service to provide security information enterprise wide. I would like to have all of this information cached memory if a previous request loaded it into memory. Then using a...
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
6
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
13
by: Dog Ears | last post by:
I've got a windows form that monitors the status of employees it polls a database every 2 seconds to fetch updates then update a underlying dataset bound to a grid using Invoke to marshal to the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.