Jen

Better Paging use SubSonic

public int SelectCount()
{
    Query q = new Query(Author.Schema);
    return q.GetCount(Author.Columns.AuId);
}

[DataObjectMethod(DataObjectMethodType.Select, true)]
public AuthorCollection FetchPaging(int maximumRows, int startRowIndex)
{
     AuthorCollection coll = new AuthorCollection();
     Query qry = new Query(Author.Schema);
     qry.PageIndex = startRowIndex + 1;
     qry.PageSize = maximumRows;

     coll.Load(qry.ExecuteReader());
     return coll;
}

0 意見: