Hi
I get data from an cvs file and wuld like to store the data in a Hashtable, how does that work
I mange to store ("key","data") ~ ("001","John Doe")
but not ("001","John Doe","66539","KS","USA")
I will be greatfull for any useful hint about the problem.
//Matt
Sweden

Store data in a Hashtable
Tomas Galvez
A hashtable stores key-value pairs. This means 1 key and 1 value. The value is of type Object, so you can store anything in there. In your case, you would have to create a class that contains the data for John Doe and add an instance of the class to the hash table
public class Person
{
}
To store the data in the Hashtable, use the following:
HashTable table = new HashTable;
Person p = new Person();
p.Name = "John Doe";
p.Zip = "66539";
p.State = "KS";
p.Country = "UA"
able.Add("001", p);
To retrieve the data from the HashTable, you'll have to cast the value to a Person object (as the value in the Hashtable is stored as type 'Object')
Person p = (Person)HashTable["001"];