4 Replies - 762 Views - Last Post: 15 November 2011 - 08:54 AM Rate Topic: -----

#1 farshadak2004  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 10
  • Joined: 15-November 11

question about Hashtable in C#

Posted 15 November 2011 - 08:21 AM

I'm building a dictionary and I have a database of words with equivelant meaning in Access file. I want to use hash table for finding the words and the meaning. My question is how to implement the hashtable which can use the file as the reference. or any other guide you might have about this case?
Is This A Good Question/Topic? 0
  • +

Replies To: question about Hashtable in C#

#2 lordofduct  Icon User is online

  • I'm a cheeseburger
  • member icon


Reputation: 2533
  • View blog
  • Posts: 4,633
  • Joined: 24-September 10

Re: question about Hashtable in C#

Posted 15 November 2011 - 08:25 AM

You want to implement a Hashtable, as in write your own? Because a Hashtable already exists...

Or do you mean you want to know how to utilize the existing Hashtable? In which case, here's the documentation for that class with some example code at the bottom:

http://msdn.microsof....hashtable.aspx
Was This Post Helpful? 0
  • +
  • -

#3 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4463
  • View blog
  • Posts: 7,777
  • Joined: 08-June 10

Re: question about Hashtable in C#

Posted 15 November 2011 - 08:28 AM

Also, you don't need to use a Hashtable in C# anymore. There's a more convenient construct: Dictionary<TKey, TValue>. It is a generic hash table.
Was This Post Helpful? 2
  • +
  • -

#4 farshadak2004  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 10
  • Joined: 15-November 11

Re: question about Hashtable in C#

Posted 15 November 2011 - 08:36 AM

View Postlordofduct, on 15 November 2011 - 08:25 AM, said:

You want to implement a Hashtable, as in write your own? Because a Hashtable already exists...

Or do you mean you want to know how to utilize the existing Hashtable? In which case, here's the documentation for that class with some example code at the bottom:

http://msdn.microsof....hashtable.aspx


Yes, I mean how to utilize the existing hashtable. Sorry my question was confusing. Thank you very much. I will look at the link and reply you about how useful was it.
Was This Post Helpful? 0
  • +
  • -

#5 lordofduct  Icon User is online

  • I'm a cheeseburger
  • member icon


Reputation: 2533
  • View blog
  • Posts: 4,633
  • Joined: 24-September 10

Re: question about Hashtable in C#

Posted 15 November 2011 - 08:54 AM

Curtis also points out the very useful Dictionary class as well that has type safety and the sort. Which is especially useful for those types that would otherwise be 'boxed' in Hashtable.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1