Simple question: I have a stored proc that has an output of @oRetVal.
I have it coded as such:
|
After I execute the proc I have:
|
But I am getting the error: "Specified cast is not valid"
I am not sure what the issue is. The variable is created as an int and the actual param is an int. What am I doing wrong here?
Thanks
cbeebe79Posted Jun 6, 2010, 3:12 AM
sql.Parameters["@oRetVal"].Direction = ParameterDirection.InputOutput
and it solved the problem. It's amazing that the simple problems are the ones that can slow you down the most, lol.
Regards
PJ MartinsPosted Jun 5, 2010, 8:35 PM
retVal = Convert.ToInt16(sql.Parameters["@oRetVal"].Value);