title: Invalid cast from 'System.Double' to 'System.Nullable`
body: <p>I've the following function which was based on this inital <a href="https://stackoverflow.com/questions/19723604/generic-function-to-handle-datatype-conversion">Generic function to handle DataType Conversion</a></p>
  
  <pre><code>public static T ConvertFromDB&lt;T&gt;(object value)
  {
    return value == DBNull.Value ? default(T) : (T)Convert.ChangeType(value, typeof(T));
  }
  </code></pre>
  
  <p>It works fine.  However when passing in a double like 0 I get the following exception;</p>
  
  <blockquote>
    <p>Invalid cast from 'System.Double' to
    'System.Nullable`1[[System.Double, mscorlib, Version=4.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.</p>
  </blockquote>
  
  <p>I've tried casting as a float but still the same.  Any ideas why this is happening ?</p>