Hi all:
I m trying to get the return value of a stored procedure with
....
DbCommand command = connection.Crea teCommand();
command.Command Text = "Exec some_SP";
command.Command Type = CommandType.Sto redProcedure;
int temp = command.Paramet ers.Add(new OdbcParameter(" @ReturnValue",
OdbcType.Int, 15));
DbParameter parameter = command.Paramet ers[temp];
parameter.Direc tion = ParameterDirect ion.Output;
command.Execute NonQuery();
return command.Paramet ers["@ReturnVal ue"].Value.ToString ()
....
however the @ReturnValue is _always_ 0 (and i know it shouldn't be)
what s the problem?
is it the way I set up the parameter?
I m trying to get the return value of a stored procedure with
....
DbCommand command = connection.Crea teCommand();
command.Command Text = "Exec some_SP";
command.Command Type = CommandType.Sto redProcedure;
int temp = command.Paramet ers.Add(new OdbcParameter(" @ReturnValue",
OdbcType.Int, 15));
DbParameter parameter = command.Paramet ers[temp];
parameter.Direc tion = ParameterDirect ion.Output;
command.Execute NonQuery();
return command.Paramet ers["@ReturnVal ue"].Value.ToString ()
....
however the @ReturnValue is _always_ 0 (and i know it shouldn't be)
what s the problem?
is it the way I set up the parameter?
Comment