How to retrieve data from hashtable when value is given as an object
<p>hi I want to enter three values into hash table so I entered one value as key and other two converted them into object and passed as value`</p>

<pre><code>class UsingHashTable
{
    public int empId;
    public String empName { get; private set; }
    public decimal salary { get; private set; }

    public UsingHashTable(string empName, decimal salary)
    {
        this.empName = empName;
        this.salary = salary;
    }

    Hashtable employeeHash = new Hashtable();

    UsingHashTable emp;

    Console.WriteLine("Enter Employee ID ");
    empId = Convert.ToInt32(Console.ReadLine());

    Console.WriteLine("Enter Employee Name ");
    empName = Console.ReadLine();

    Console.WriteLine("Enter Salary of the employee ");
    salary = Convert.ToDecimal(Console.ReadLine());

    emp = new  UsingHashTable(empName,salary);

    employeeHash.Add(empId, emp);
}
</code></pre>

<p>Now the actual problem comes! How to retrieve the values from the hashtable where key is coming but from value I need to retrieve two values how??</p>

<pre><code>foreach(DictionaryEntry temp in employeeHash) 
{
    Console.WriteLine(temp.Key + " " + temp.Value.eName + " " + temp.Value.salary);
}
</code></pre>

<p>I am exactly getting the error at temp.Value.eName and temp.Value.salary</p>