Cannot access a variable due to the access level protection
<p>I have following classes:</p>

<pre><code>class Department
{
 private string departmentId;
 private string departmentName;
 private Hashtable doctors = new Hashtable();//Store doctors for 
                                                //each department
public Hashtable Doctor
{
 get { return doctors; }
}
}
</code></pre>

<p>I have an array list that holds department objects:</p>

<pre><code>private static ArrayList deptList = new ArrayList();
public ArrayList Dept
{
 get { return deptList; }
}
</code></pre>

<p>I am trying to get all the doctors(the Hashtable in department class) from each department:</p>

<pre><code>foreach (Department department in deptList) 
        {
foreach (DictionaryEntry docDic in department.Doctor)
        {
foreach (Doctor doc in docDic.Value)//this is where I gets an error
{

if (doc.ID.Equals(docID))//find the doctor specified
{
}
}
}
}
</code></pre>

<p>But I can not compile the program. It gives an <strong>Error</strong>:</p>

<pre><code>foreach statement cannot operate on variables of type 'object' because
'object' does not contain a public definition for 'GetEnumerator'
</code></pre>
