Permalink
Browse files

Fix bug in paging.

  • Loading branch information...
Joe Wasson
Joe Wasson committed Apr 26, 2011
1 parent dd760ba commit 9daf6160bd81d56b0d15882d2850df9d92844436
Showing with 1 addition and 1 deletion.
  1. +1 −1 Massive.cs
View
@@ -343,7 +343,7 @@ public class DynamicModel {
}
var sql = string.Format("SELECT {0} FROM (SELECT ROW_NUMBER() OVER (ORDER BY {2}) AS Row, {0} FROM {3} {4}) AS Paged ", columns, pageSize, orderBy, TableName, where);
var pageStart = (currentPage - 1) * pageSize;
- sql += string.Format(" WHERE Row >={0} AND Row <={1}", pageStart, (pageStart + pageSize));
+ sql += string.Format(" WHERE Row > {0} AND Row <={1}", pageStart, (pageStart + pageSize));
countSQL += where;
result.TotalRecords = Scalar(countSQL, args);
result.TotalPages = result.TotalRecords / pageSize;

0 comments on commit 9daf616

Please sign in to comment.