locked
11.2 ODP.Net Issue with Null Values. RRS feed

  • Question

  • I am working on Migration Project which is earlier devloped in VS 2003 and Oracle 8.2 .
    Now we are upgrading the environment to VS 2008 and Oracle 11.2. accordingly we have updated the ODP to 11.2 as well.

    So while Runtime null Check condition is getting failed. the reason is application previously returned an empty string, now a string with the value "null" is obtained.

    We Identified two solution to resolve this issue :

    Solution 1:

    We can replace the null check applied on OracleDBType in project by using Inullable interface.
    The OracleDBType inherits Inullable Interface.
    For Eg:

    AS IS :

    (Convert.IsDBNull(Param[149].Value))

    To BE :

    (((INullable)Param[149].Value).IsNull)

    Solution 2:
    We can use OracleDbTypeEx instead of OracleDbType in our oracle parameter declaration.
    OracleDbTypeEx will return the value of DBType and due to which we can recognize the DB Null.
    For Eg:

    AS IS :

    OracleDbType = OracleDbType.Decimal

    To BE:

    OracleDbTypeEx = OracleDbType.Decimal

    NOTE: With Above solution we will have to make many code changes,
    But we are looking for some global or configurational change due to which with minimum code changes application will work.

    Any help would be highly appreciated!!!!!!!.

    Friday, December 6, 2013 12:08 PM

Answers