Total Counts When Using Paging

Posts   
 
    
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 26-Apr-2007 06:27:59   

LLBLGen 2.0 Self Servicing ASP.NET v2.0

I'm using custom paging in a web page. My data source comes from a method that uses the GetMultiAsDataTable and I pass in the PageNumber and PageSize. I want to display a label that says "Page x of y", but since I'm using the PageNumber and PageSize parameters, my DataTable.Rows.Count is only PageSize. Is there a way to get the total number of rows in the resultset BEFORE the paging is applied? Obviously, I could hit the database again, but I'd like to refrain from that if possible.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 26-Apr-2007 09:50:49   

I dont know a way to achieve that without a extra DB call disappointed . I make a DBCount call and then after a division, I get the total number of pages.

David Elizondo | LLBLGen Support Team