I\'ve got a System.Generic.Collections.List(Of MyCustomClass) type object.
Given integer varaibles pagesize and pagenumber, how can I query only any single page of MyCus
Hi There is a wicked thing called PagedList which i got when watching a Rob Conery Screen Cast.
http://blog.wekeroad.com/2007/12/10/aspnet-mvc-pagedlistt/
It has all the Skip and Take stuff built in.
All you do is call
var query = from item in DB.Table
where item.Field == 1
orderby item.Field2
select item;
PagedList pagedList = query.ToPagedList(pageIndex, pageSize);
Hope it helps.. I'm using it now and it works ok for linq to entities. With Linq to entities you have to perform an Orderby before you can use Skip and Take.