how to findout which Class/Object is calling current winForm/object in c#
<p>hey guys, i have 3 winForms named carForm,parForm and updateForm, so there's <code>updateForm.show()</code> method in both carForm n parForm, while m in updateForm i want to know which class/form has called updateForm, so that i can update the respected class db. Currently i'm setting up a <code>public</code> global <code>variable</code> to verify that which form is calling updateForm..but i was thinkin' is there's another way to do this, i guess Reflection can solve this issue, but i'm not able to solve it, here's my code</p>

<pre><code>///carForm
public class carForm:Form
{
    Program.globalvariable="CAR";    //global variable
    UpdateFrom updateForm=new UpdateForm();
    updateForm.Show();

}

///parForm
public class parForm:Form
{
     Program.globalvariable="PAR";
     UpdateFrom updateForm=new UpdateForm
     updateForm.Show();

}

///updateForm
public class updateForm:Form
{
    if(Program.globalvariable=="CAR")
       ///code for update CAR db table
    else if(Program.globalvariable=="PAR")
       ///code for update PAR db table

    Type obj = GetType();  //This is what i was tryin' using Reflection but giving error

}
</code></pre>

<p>so if i get the calling Class/Objects info, i can update respected DB table,</p>

<p>can ne1 know hw to do this with Reflection,</p>
