Menu

#12 Exception when setting boolean parameter for Oracle

closed-fixed
None
5
2005-04-15
2005-03-30
Sean Flook
No

I am using the following line of code to set a parameter
in a stored procedure

MpmParameter invalidParam =
daStreet.SelectCommand.Parameters.Add
("@bInvalidOnly", MpmType.Boolean, 1);

When run against SQL Server this works fine, but when
run against an Oracle database I get the following
exception

"Value does not fall within the expected range."

Discussion

  • Fredrik Ĺlund

    Fredrik Ĺlund - 2005-03-31
    • assigned_to: nobody --> fral
     
  • Fredrik Ĺlund

    Fredrik Ĺlund - 2005-04-07

    Logged In: YES
    user_id=897766

    Oracle does not support a Boolean data type. You get an
    ArgumentException from Oracle when Mpm tries to set
    OracleParameter.DbType to DbType.Boolean. The error message
    from Oracle is unfortunately not very informative...

     
  • Fredrik Ĺlund

    Fredrik Ĺlund - 2005-04-07

    Logged In: YES
    user_id=897766

    A new version that wraps the ArgumentException and adds a
    more informative error message have been commited to CVS.

     
  • Fredrik Ĺlund

    Fredrik Ĺlund - 2005-04-07
    • status: open --> open-fixed
     
  • Fredrik Ĺlund

    Fredrik Ĺlund - 2005-04-15
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.