I have a problem with accessing output in the stored procedure below
DbParameter DbParm = command.CreateParameter();
DbParm.Direction = ParameterDirection.Output;
DbParm.ParameterName = "@SomeValue";
DbParm.DbType = DbType.Int32;
DbParm.Value = null;
command.Parameters.Add(DbParm);
After executing the procedure
command.Parameters["@SomeValue"].Value;
Well it always returns Null,I can access to the second second select though.Here is the procedure:
CREATE PROCEDURE SomeThing
@SomeValue int OUTPUT,
AS
SELECT @SomeValue=ID
FROM SomeTable
WHERE ID=10;
SELECT *
FROM SomeTable;
GO