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

Hashtable, key-value-pair (string)

Does there exist a class similar to a hashtable which provides a key-value
pair collection. The key and the value has to be a string?
Jul 19 '05 #1
3 7395
Hi,

take a look at:
System.Collections.Specialized.HybridDictionary

Keys and Values are both objects. But all in DotNET is an object. So you can
pass a string in it.

cu
Bjoern Wolfgardt

<ol**********@zurich.ch> schrieb im Newsbeitrag
news:3f******@news.zurich-datacenter.com...
Does there exist a class similar to a hashtable which provides a key-value
pair collection. The key and the value has to be a string?

Jul 19 '05 #2
Oliver,
System.Collections.Specialized.StringDictionary is a HashTable where the key
& value are string.

System.Collections.Specialized.NameValueCollection is an ordered HashTable
where the key & value are string.

Both System.Collections & System.Collections.Specialized have other
collection classes and base collection classes that you can use or use to
build your own collections.

Hope this helps
Jay

<ol**********@zurich.ch> wrote in message
news:3f******@news.zurich-datacenter.com...
Does there exist a class similar to a hashtable which provides a key-value
pair collection. The key and the value has to be a string?

Jul 19 '05 #3
Hi,

it is a specialized class. You don't have to care about how big the
collection will become. It will switch to ListDictonary if the Collection is
small and if it becomes bigger it will switch to Hashtable.
But I didn't remember that there is a collection that uses strings as values
and keys. So look at Jays answer.

cu
Bjoern Wolfgardt

<ol**********@zurich.ch> schrieb im Newsbeitrag
news:3f********@news.zurich-datacenter.com...
What's the difference between the class Hashtable and System.Collections.Specialized.HybridDictionary? Both use objects for key's
and value's.
Oliver

Jul 19 '05 #4

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

Similar topics

2
by: Alfonso Morra | last post by:
I am implementing an application which requires the storage of a large number of items in a cache. I have 3-tuple key reprented by a struct, as well as an n-tuple (n is fixed) dataset, also...
4
by: Gary Davis | last post by:
Once a day or so, I receive an error on a fairly active website that calls this StrMixed.cs method constructor. 99% of the time there is no exception: System.Web.HttpUnhandledException:...
1
by: Derrick | last post by:
I'm seeing what looks like a leak with Hashtable, but guessing it is something I'm doing - void func1() { Hashtable hash = getHash(); //Loop thru assorted data, check to see if data exists...
2
by: Wamiq Ansari | last post by:
Hi, I am using a System.Windows.Forms.Label object as key in my Hashtable. One thing that has surprised me is that if I create two Label objects with same properties (ie. Name,...
5
by: Matthias Kwiedor | last post by:
Hi! What i want to do, is to put an ArrayList into a Hashtable. So i can access the ArrayList fast over the key-indexing of the Hashtable. What i did is to put the ArrayList into the...
2
by: MFRASER | last post by:
How do I go about looping through a hash table and removing items. I know how do this in a collectionbase, but can't iterate through the hash table with out getting an error. Here is my sample...
3
by: Frank | last post by:
Hi! I'm kinda stuck here. I have an Hashtable with with my custom "Item" Object. The key used in the Hashtable is the "Item.Id", i have selected this key because with a lot of functions i can...
8
by: JackRazz | last post by:
Is it possible to create a hashtable that doesn't store the key? I have a very large hashtable and I just want it to store the HashCode and the Value (two Int16s). Thanks - JackRazz
4
by: Nadav | last post by:
Hello. I have a Hashtable, to which I insert key and values. When I go over the hashtable with "foreach" later on, the items are not coming out at the order I inserted them. A quickwatch showed...
8
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 =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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....

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.