--计算总记录数
if (@SqlWhere='' or @sqlWhere=NULL)
set @sql = 'select @totalRecord = count(*) from ' + @TableName
else
set @sql = 'select @totalRecord = count(*) from ' + @TableName + ' with(nolock) where ' + @sqlWhere
EXEC sp_executesql @sql,N'@totalRecord int OUTPUT',@totalRecord OUTPUT--计算总记录数
end
--计算总页数
select @TotalPage=CEILING((@totalRecord+0.0)/@PageSize)
单个参数输出
prams[10].Direction = ParameterDirection.Output;
DataSet ds = helper.ExecuteDataSet("uspGetNewArrives", prams);
recordCount = int.Parse(prams[10].Value.ToString());