Can you use
int blah = Convert.ToInt32(cmd.ExecuteScalar());
When the sproc's last statement does:
RETURN @value
I can only get it to work if it does:
SELECT @value
Also, this gives me a object null exception:
int blah = (int)cmd.ExecuteScalar();
isn't convert.toint32 and (int) the same thing but one is a wrapper of the other?