dynamic type casting
<p>Now I think it is clear.
I have created a object oriented database in C#.NET where two classes are there. Student and contacts. Contacts are inside student. I am Retrieving all objects in Object array. Class student has fields <code>name</code> and <code>age</code>, while contact has <code>mobileID</code>.</p>

<p>Now I am creating a query through textboxes. Created textboxes. one for select and one for from. in from(var1) class name is accepted , while in select(var2), field name is accepted. If user want to see name of all the objects, then var2 "name" should be input; but I am not able to get this message </p>

<pre><code>messageBox.show(obj[0] as Student).var2);
</code></pre>

<p>it is giving error var2 ,     'object' does not contain a definition for 'var2' and no extension method 'var2' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)   </p>

<p>Same issue if instead of Student if I give var1 <code>messageBox.show(obj[0] as var1).var2);</code></p>

<p>Can I do this?</p>
