Set your Direction return value ParameterDirection.ReturnValue to ParameterDirection.ReturnValue , and after running the command, get the return parameter value:
SqlParameter myReturnParam = command.Parameters.Add("@MyReturnValue", SqlDbType.Int); myReturnParam.Direction = ParameterDirection.ReturnValue; // Execute your Command here, and get the value of your return parameter : int myReturnValue = (int)command.Parameters["@MyReturnValue"].Value;
source share