Hi,
Given a query for example:
from Users u where u.Country = "US"
I have a web app with a custom grid.
How do I query NHibernate to bring back a specfic page results given page size and index???
Malcolm
Hi,
Given a query for example:
from Users u where u.Country = "US"
I have a web app with a custom grid.
How do I query NHibernate to bring back a specfic page results given page size and index???
Malcolm
Use SetFirstResult and SetMaxResults on the query or criteria:
int pagesize = 10;
int page = 2;
query = session.createQuery("...")
.SetFirstResult(pagesize * page)
.SetMaxResults(pagesize);