更新时间:2022-12-03 13:56:13
您在代码中使用了其他名称作为参数.尝试更改
You're using a different name for the parameter in your code. Try changing
ename.ParameterName = "ename";
到
ename.ParameterName = "P_ename";
ALSO
您需要为输出值添加一个参数:
You need to add a parameter for the output value:
OracleParameter result = new OracleParameter();
result.OracleType = OracleType.VarChar;
result.Direction = ParameterDirection.ReturnValue;
orclCmnd.Parameters.Add(result);
使用ExecuteNonQuery调用函数后,从参数中获取值:
And get the value from the parameter after calling the function with ExecuteNonQuery:
orclCmnd.ExecuteNonQuery();
strResult = result.Value.ToString();