Nhibernate 分页
public IList<Student> GetStudentByPage(int pageSize, int pageIndex, string SName)
{
ISession session = NHibernateHelper.GetCurrentSession();
ITransaction trans = session.BeginTransaction();
//HQL查询
IList<Student> studentList = new List<Student>();
//string sql = "from Student";
//studentList = session.CreateQuery(sql)
// .SetFirstResult((pageIndex - 1) * pageSize)
// .SetMaxResults(pageSize)
// .List<Student>(); //SQL查询 //studentList = session.CreateSQLQuery("SELECT * FROM Student")
// .SetFirstResult((pageIndex - 1) * pageSize)
// .SetMaxResults(pageSize)
// .SetResultTransformer(Transformers.AliasToBean<Student>()).List<Student>();
return studentList;
}
Nhibernate 分页的更多相关文章
- NHibernate分页
转载:http://www.cnblogs.com/tenghoo/archive/2011/02/14/1954393.html NHibernate专题:http://kb.cnblogs.com ...
- Nhibernate分页测试续
Nhibernate分页测试续(附源码) 接着上一篇Nhibernate分页测试,最近一直在接触Nhibernate,接触的越多.了解越深,越是感觉他的强大,很多功能都封装的很好,对数据操作是那么的简 ...
- Nhibernate 分页功能
cs: public IEnumerable<ArticleView> MyGetAll(int start, int limit, ref int count) { try { var ...
- Asp.Net MVC结合ExtJs gridPanel 分页和高度自适应
Ext.onReady(function () { gridPanel(); var panel = Ext.getCmp('gridPanel'); window.onresize = functi ...
- NHibernate使用ICriteria分页并返回数据库记录总条数
最近在使用NHibernate,发现进行分页查询无法得到数据库记录的总条数,在网上找了很久没找到具体的实现方法,找到的资料都说得不是很清楚,研究了很久终于写出了这样一个方法. NHibernate下分 ...
- “MVC+Nhibernate+Jquery-EasyUI” 信息发布系统 第六篇(图片新闻的添加以及带分页的静态页的生成)
“MVC+Nhibernate+Jquery-EasyUI” 信息发布系统 第六篇(图片新闻的添加以及带分页的静态页的生成) 一.这篇文章主要是要实现:图片新闻的添加,无刷新图片的上传,以及添加新闻静 ...
- NHibernate初学三之条件查询(Criteria Queries)与AspNetPager分页实例
NHibernate除了SQL与HQL两种查询操作外,还有一种就是条件查询Criteria,本文将从网上整理一些Criteria的理论及小实例,最后通过一个结合AspNetPager分页来加深理解,必 ...
- 基于jqgrid + ashx + nhibernate的分页
因为我目前运维的是一个webform项目,项目中未用到分页的功能,我百度了很多文章也没有一篇是结合jqgrid + ashx + nhibernate的分页,可能是因为后台要请求ashx的原因,不像m ...
- Nhibernate Icreteria 分页查询
1.创建查询条件,条件为一个ICreterion的列表 /// /// 创建Criteria(不含order,因为获取总数的时候,为了性能考虑,不加order) /// ...
随机推荐
- [转载]Python兵器谱
转载自:http://www.52nlp.cn/python-网页爬虫-文本处理-科学计算-机器学习-数据挖掘 曾经因为NLTK的缘故开始学习Python,之后渐渐成为我工作中的第一辅助脚本语言,虽然 ...
- 环境搭建之maven分布式系统
shoppingmall项目: 一.父工程 shoppingmall-parent (packaging为pom) 此是本项目的顶级工程,所有子工程都应该继承他,主要可承担以下任务: a.集中定义 ...
- 关于C语言指针的问题
在学习关于C语言指针的时候,发现这样一个问题,代码如下: #include<stdio.h> #include<stdlib.h> #include<string.h&g ...
- Greenplum 数据库架构分析
Greenplum 数据库是最先进的分布式开源数据库技术,主要用来处理大规模的数据分析任务,包括数据仓库.商务智能(OLAP)和数据挖掘等.自2015年10月正式开源以来,受到国内外业内人士的广泛关注 ...
- 使用IndexReader.repen提高搜索速度
1,使用indexreader创建indexsearcher. 2,indexsearcher在使用完了以后不要关闭. 3.使用indexreader.isCurrent()判断索引是否被indexw ...
- Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl
严重: Exception sending context initialized event to listener instance of class org.springframework.we ...
- [Javascript] Logging Pretty-Printing Tabular Data to the Console
Learn how to use console.table to render arrays and objects in a tabular format for easy scanning ov ...
- [Javascript] Intro to the Web Audio API
An introduction to the Web Audio API. In this lesson, we cover creating an audio context and an osci ...
- Reso | The Linux Command Line 的中文版
http://book.haoduoshipin.com/tlcl/book/zh/ 本书是 The Linux Command Line 的中文版, 为大家提供了多种不同的阅读方式. 中英文双语版- ...
- sbt 配置
1. SBT使用local maven repository,下载的库依然放在 ~/.m2/repository 2. SBT assembly 会把依赖库打包到一个jar包,需要使用assembly ...