As far as I remember If you use ODP.NET, you need to specify the retVal parameter as the first.
Something is wrong with ODP.NET, and it does not associate parameters with the provided parameter names, but with the order of the parameters.
So just change the order to:
cmd.Parameters.Add(returnVal); cmd.Parameters.Add(p_one); cmd.Parameters.Add(p_two);
And in my sources, I found that the returned parameter is called "RETURN" (not sure what it considers):
OracleParameter returnVal = new OracleParameter("RETURN",null);
Yeah, and one more thing. It will never reach the last line - cuase return will stop executing. Close it as soon as you no longer need it.
RETURN returnVal; CLOSE USERFINDER;
source share