[Mono-dev] System.Data.OracleClient.OracleParameter.SetOracleType() bug?

Tom Spink tspink at gmail.com
Sat Oct 1 05:54:41 EDT 2011


On 29 September 2011 14:53, iamwind <iamwind76 at hotmail.com> wrote:
<snip>

>
> Would you modify the code like following?
>
> Type valType = typeof(System.String);
>                        if(value != null)
>                        {
>                                valType = value.GetType ();
>                  }
>
> thanks!
>
>
Well, without any other context, I'd do this:

///
if (value == null)
  valType = typeof(System.DBNull);
else
  valType = value.GetType();
///

Which means for a 'null value', the 'value type' would be DBNull.

Hope this helps,

-- 
Tom Spink
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20111001/52de1851/attachment.html 


More information about the Mono-devel-list mailing list