標籤:
PagerAttributes.FieldCollection 列名 PagerAttributes.TableName 表名 PagerAttributes.SortFieldName 排序列名 PagerAttributes.SortDirection 排序方式 PagerAttributes.PageIndex 當前頁 PagerAttributes.ItemsPerPage 每頁顯示大小 DataSet ds = new DataSet(); StringBuilder strSql = new StringBuilder(); strSql.Append(" SELECT *"); strSql.Append(" FROM ("); strSql.Append(" SELECT ROWNUM RN,t.* FROM "); strSql.Append(" ( SELECT " + PagerAttributes.FieldCollection); strSql.Append(" FROM " + PagerAttributes.TableName); strSql.Append(" WHERE " + PagerAttributes.DefaultWhere + searchCondition.BuildConditionSql().Replace("Where", "")); strSql.Append(" ORDER BY " + PagerAttributes.SortFieldName + " " + PagerAttributes.SortDirection asc desc); strSql.Append(") t "); strSql.Append(" WHERE ROWNUM<=" + Convert.ToString((PagerAttributes.PageIndex + 1) * PagerAttributes.ItemsPerPage)); strSql.Append(" ) "); strSql.Append(" WHERE RN>" + Convert.ToString((PagerAttributes.PageIndex) * PagerAttributes.ItemsPerPage)); ds = DbHelperOra.Query(strSql.ToString());
Oracle分頁文法