472,952 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

Hashtable vs. Dictionary.

What is the difference between a hashtable and a dictionary? Why isn't
Hashtable derived from DictionaryBase?
Nov 15 '05 #1
4 43802
The HashTable is the base class that is weakly type; the DictionaryBase
abstract class is stronly typed and uses internally a HashTable.

For more information, look here:
http://www.microsoft.com/belux/fr/ms...lections1.mspx

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Peter Rilling" <pe***@nospam.rilling.net> schreef in bericht
news:uv**************@TK2MSFTNGP12.phx.gbl...
What is the difference between a hashtable and a dictionary? Why isn't
Hashtable derived from DictionaryBase?

Nov 15 '05 #2
So conceptually there is really not much of a difference, right?

"Jan Tielens" <ja*@no.spam.please.leadit.be> wrote in message
news:OB**************@tk2msftngp13.phx.gbl...
The HashTable is the base class that is weakly type; the DictionaryBase
abstract class is stronly typed and uses internally a HashTable.

For more information, look here:
http://www.microsoft.com/belux/fr/ms...ens/collection
s1.mspx
--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Peter Rilling" <pe***@nospam.rilling.net> schreef in bericht
news:uv**************@TK2MSFTNGP12.phx.gbl...
What is the difference between a hashtable and a dictionary? Why isn't
Hashtable derived from DictionaryBase?


Nov 15 '05 #3

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
So conceptually there is really not much of a difference, right?

Just easier to work with. DictionaryBase is provided to make writing
strongly typed dictionaries easier, if you want to work with all
dictionaries you should use IDictionary as the base type.
"Jan Tielens" <ja*@no.spam.please.leadit.be> wrote in message
news:OB**************@tk2msftngp13.phx.gbl...
The HashTable is the base class that is weakly type; the DictionaryBase
abstract class is stronly typed and uses internally a HashTable.

For more information, look here:

http://www.microsoft.com/belux/fr/ms...ens/collection s1.mspx

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Peter Rilling" <pe***@nospam.rilling.net> schreef in bericht
news:uv**************@TK2MSFTNGP12.phx.gbl...
What is the difference between a hashtable and a dictionary? Why isn't Hashtable derived from DictionaryBase?



Nov 15 '05 #4
You can work with a Hashtable out of the box, but to use the DictionaryBase
class you'll have to create a new class and inherit from the DictionaryBase
class.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
So conceptually there is really not much of a difference, right?

"Jan Tielens" <ja*@no.spam.please.leadit.be> wrote in message
news:OB**************@tk2msftngp13.phx.gbl...
The HashTable is the base class that is weakly type; the DictionaryBase
abstract class is stronly typed and uses internally a HashTable.

For more information, look here:

http://www.microsoft.com/belux/fr/ms...ens/collection s1.mspx

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Peter Rilling" <pe***@nospam.rilling.net> schreef in bericht
news:uv**************@TK2MSFTNGP12.phx.gbl...
What is the difference between a hashtable and a dictionary? Why isn't Hashtable derived from DictionaryBase?



Nov 15 '05 #5

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

Similar topics

2
by: Duncan Bayne | last post by:
Hi All, Be careful when indexing Hashtable elements by number. The following code will create two quite distinct entries in an Hashtable: myHashtable.Add((int)666, "Foo");...
4
by: Matt C. | last post by:
I bet I know the answer already. I have a hashtable (hMaster) that holds several hashtables ("hTables") each of which holds other hashtables ("hColumns"). Presently, I am getting at the info I...
11
by: Crirus | last post by:
Easyest and fastest way... :) -- Ceers, Crirus ------------------------------ If work were a good thing, the boss would take it all from you ------------------------------
12
by: Marty | last post by:
Hi, Is there a way when using a hashtable in VB.NET to add value of a specific type and retrieve that same value without having to cast it to the original type? Thanks Marty
2
by: Ray Cassick \(Home\) | last post by:
I have a hashtable in a class that contains key (strings) value (integers, strings, longs, etc...) data pairs. I want to move the data to another (different) class instance for processing. ...
3
by: Anders Borum | last post by:
Hello! I am using Hashtables to cache data in services and am looking at generics for typed access (I control the key/value types). However, I was surprised to see that the Dictionary throws a...
5
by: Mark Rae | last post by:
Hi, In v1.x, I used to use the following code to create a case-insensitive Hashtable: Hashtable MyHashtable = new Hashtable(CaseInsensitiveHashCodeProvider.Default,...
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 =...
10
by: chrisben | last post by:
Hi, Here is the scenario. I have a list of IDs and there are multiple threads trying to add/remove/read from this list. I can do in C# 1. create Hashtable hList = Hashtable.Synchronized(new...
9
by: raylopez99 | last post by:
Hello all Im trying to get the below to work and cannot get the format right. Its from this example: http://msdn.microsoft.com/en-us/library/8627sbea(VS.71).aspx What it is: Im trying...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.