System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary; exception getting in c#
<p>I have a dictionary am getting thee value from the dictionary dynamically, but some times its gives exception . Can someone kindly help on this</p>

<p>How can i make a check the value of test[typeof(T)].Key.ColumnName, before doing some action in dictionary.</p>

<p>If i use !string.isnullorEmpty , there itself its throwing error.
code</p>

<pre><code> int ID=123;
 private Dictionary&lt;Type, DataTableAttribute&gt; test
 parameters.AddInt32Parameter(test[typeof(T)].Key.ColumnName, ID);
</code></pre>

<p>--
thanks</p>