Problem in retrieving a number return value from stored function
447110Jul 13 2005 — edited Jul 16 2005I have a problem in returning a number data type from a stored function.
My function accepts parameters like x,y and returns a number to my BLL component in DOT NET(C#). All the parameter bindings are done correctly and if I try to assign the return value from the stored function(which is of OracleDbType.Decimal type) I get a System.Invalid Cast Exception error in Dot Net.
For Ex. the parameter name which returns the return value is OraParamRetVal and I get the above error in the following line:
int tempvar = OraParamRetVal.Value;
To overcome the above error, I am Converting the return value to a string and then back to integer as given below:
int tempvar = Convert.ToInt32(OraParamRetVal.Value.ToString());
Is there any direct way of getting the (Number) return value without converting it to string.
Thanks n advance.
K R Chandra Sekar