473,505 Members | 13,925 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HashTable LookUP

I have created a hash table;

dim h as new hashtable
h.Add (0, "No Choice")
h.Add(1, "First Choice")
h.Add(2, "Second Choice")

What I want to do is supply a value such as "First Choice" and return the
key 1. I have found out how to enumerate all the values to the console, but
I simply want to return the Key for a specific value or the value for a
specific key. Any help would be appreciated. Thanks.

--
Dennis in Houston
Nov 21 '05 #1
1 941
Thanks anyway but I've got I think;

dim a as string = h(1).ToSTring
I have created a hash table;

dim h as new hashtable
h.Add (0, "No Choice")
h.Add(1, "First Choice")
h.Add(2, "Second Choice")

What I want to do is supply a value such as "First Choice" and return the
key 1. I have found out how to enumerate all the values to the console, but
I simply want to return the Key for a specific value or the value for a
specific key. Any help would be appreciated. Thanks.

--
Dennis in Houston

Nov 21 '05 #2

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

Similar topics

2
1493
by: Tony Godt | last post by:
I have build an application which uses Hashtables for storing information in collections. My question is simple - I wonder how big a (performance) difference it is, to lookup a value in a...
4
8341
by: Anders Borum | last post by:
Hello! I have a list of singleton classes (model managers) that store objects internally using hashtables. Each of these classes use a single hashtable to store e.g. users, pages, elements and...
4
5219
by: JezB | last post by:
I have a hashtable (h) of class objects keyed by a string (k) - the class (c) object stored in each hastable entry has two attributes (a1 and a2). I want to iterate through the entries of the...
6
6531
by: Steven Wolf | last post by:
Hi guys, can a hashtable be faster than a sql server?? i made my own O/R mapping with an "entity cache" (caching all mapped objects). So, when i get some data from my sql server, i map that data...
7
1752
by: Naveen Mukkelli | last post by:
Hi, I'm working on a Client/Server application. Server application needs to keep track of all the clients. I'm planning to use a Hashtable for this purpose. There would be thousands of...
2
2999
by: John Grandy | last post by:
What are good rules of thumb to use when deciding between a NameValueCollection, an ArrayList, or a Hashtable ?
10
15077
by: Ken Foster | last post by:
I have a hashtable keyed by some name, holding an instance of an object. Most of the time I use the hashtable in the traditional sense, given a name, I lookup the object, then I run a method on...
8
2062
by: Martin Pöpping | last post by:
Hello, I´ve implemented a Hashtable with Int-Keys and Double Values. Now I want to get the i-th Int-Key of my hashtable. How do I do that? I tried it like that: ICollection intKeys =...
14
1364
by: Joseph Geretz | last post by:
Basically, I just need an efficient way to store and retrieve keys from a list. I don't need key/value pairs. I've implemented this with the standard HashTable, but the value column is a waste...
2
2453
by: Bruce | last post by:
Hi I am having a problem understanding the exact advantages of using an ArrayList over a Hashtable in any situation. In most areas of an application I am working on, lookup needs to be fast. If I...
0
7213
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
7298
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,...
1
7017
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
7471
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...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.