<div class="gmail_quote">On 29 September 2011 14:53, iamwind <span dir="ltr">&lt;<a href="mailto:iamwind76@hotmail.com">iamwind76@hotmail.com</a>&gt;</span> wrote:</div><div class="gmail_quote">&lt;snip&gt;<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Would you modify the code like following?<br>
<br>
Type valType = typeof(System.String);<br>
                        if(value != null)<br>
                        {<br>
                                valType = value.GetType ();<br>
                  }<br>
<br>
thanks!<br>
<font color="#888888"><br></font></blockquote><div><br></div><div>Well, without any other context, I&#39;d do this:</div><div><br></div><div>///</div><div>if (value == null)</div><div>  valType = typeof(System.DBNull);</div>
<div>else</div><div>  valType = value.GetType(); </div></div><div>///</div><div><br></div><div>Which means for a &#39;null value&#39;, the &#39;value type&#39; would be DBNull.</div><div><br></div><div>Hope this helps,</div>
<div><br></div>-- <br>Tom Spink<br>