你该怎么办寻呼与NHibernate? [英] How can you do paging with NHibernate?

查看:142
本文介绍了你该怎么办寻呼与NHibernate?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我要填充GridView控件在ASP.NET网页,只有必要的显示的行#的数据。怎样才能NHibernate的支持呢?

For example, I want to populate a gridview control in an ASP.NET web page with only the data necessary for the # of rows displayed. How can NHibernate support this?

推荐答案

的ICriteria有SetFirstResult(int i)以法,这表明的第一个项目,你希望得到(基本上是第一个数据行的页面)索引和SetMaxResult(int i)以指示的行数,你希望得到(例如,你的页面大小)。

ICriteria has a SetFirstResult(int i) method, which indicates the index of the first item that you wish to get (basically the first data row in your page) and SetMaxResult(int i) which indicates the number of rows you wish to get (e.g., your page size).

例如,此标准对象都将获得前10个结果的数据网格的:

For example, this criteria object gets the first 10 results of your data grid:

criteria.SetFirstResult(0).SetMaxResult(10);

这篇关于你该怎么办寻呼与NHibernate?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆