Type casting in between two different class
<p>I have following method return type as <code>Configuration Section</code> class and want to pass a type to another class please give me the respective solution.</p>

<pre><code> public static TestCustomConfigSecCls CompanyInfo
    {
        get
        {
            ConfigurationSection a = Instance.GetConfigSection(Key);

            return (TestCustomConfigSecCls)a;
        }
    }
</code></pre>

<p>It gives <code>Unhanded Exception</code> :- Unable to cast object of type <code>System.Configuration.DefaultSection</code> to type <code>TestCustomConfigSecCls</code>.</p>
