R
roundcrisis
Hi all:
I m trying to get the return value of a stored procedure with
....
DbCommand command = connection.CreateCommand();
command.CommandText = "Exec some_SP";
command.CommandType = CommandType.StoredProcedure;
int temp = command.Parameters.Add(new OdbcParameter("@ReturnValue",
OdbcType.Int, 15));
DbParameter parameter = command.Parameters[temp];
parameter.Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
return command.Parameters["@ReturnValue"].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.CreateCommand();
command.CommandText = "Exec some_SP";
command.CommandType = CommandType.StoredProcedure;
int temp = command.Parameters.Add(new OdbcParameter("@ReturnValue",
OdbcType.Int, 15));
DbParameter parameter = command.Parameters[temp];
parameter.Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
return command.Parameters["@ReturnValue"].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?