Visual Studio .NET - How to assign a string to hash table

Asked By Nikhal Sood on 09-Mar-07 02:26 PM
I have a comma seaparated string. I need to assign that string to a Hash table . Once i have the string values as hash items ,then need to compare the hash table items with the some listbox items i have. So need to confirm how can i assing the string to a hash table items.

hashtable - sundar k replied to Nikhal Sood on 10-Mar-07 12:26 AM

SERIALIZE A hashtable that contains only String Type

check this post out for clues!

Just as a note - a bit off topic - if your Hashtable only contains strings, and only will ever contain strings, you should consider using the .NET StringDictionary class, same usage as a normal Hashtable, but type safe, it'll save you having to cast results or calling ToString() all the time!!

You'll want:

  using System.Collections.Specialized;

at the top of your code to use it!