Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Out parameter cast issue - C#

1005328Apr 24 2013 — edited Apr 30 2013
Hi all,

Having an issue with an older application I am supporting. The data access is CSLA .Net and there is a line that updates a newly created entity id with the value from an out parameter. This is defined in the database as NUMERIC(10,0). The code looks like this:

OracleParameter opID = new OracleParameter("P_ID", OracleDbType.Int64);
//... do some stuff and save the new entity to the db
_id = (long)opID.Value;

This used to be fine on windows XP with version 9.x of ODP .Net. On a Windows 7 box with the latest version the cast fails and the return data type Decimal. This looks to me like a bug/weird behavior in the new version. Is there a workaround or something I can do to fix the issue without, preferably without changing my code?

Thanks!
Matei

Edited by: Matei on Apr 29, 2013 4:05 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2013
Added on Apr 24 2013
6 comments
547 views