Hi, I need to implement custom DataGrid paging:
http://dotnetjunkies.com/Tutorial/EA868 ... F967F.dcik
Basically, idea is called a stored proc and retrieve only those records you need on "Current" page, thereby reducing processing and data transfer. The stored procedure takes as parameters "PageNumber" and "PageSize" to compute the records to return.
Normally, without stored proc:
o_session = SetupFESRCConnection(...)
criteria = o_session.CreateCriteria(GetType(mylib.to.Company))
...
conjunc = New NHibernate.Expression.Conjunction
criteria.Add(conjunc)
disjunc = New NHibernate.Expression.Disjunction
conjunc.Add(disjunc)
disjunc.Add(Expression.EqExpression.Eq("CompanyCode", companyCode))
company_list = criteria.List()
But how can I specify criteria "I just want page 3 data given page size = 10 records per page"? However, can I retrieve via stored procedure using NHibernate?
Thanks in advance.