分页问题..不难..只是出错... [问题点数:100分,结帖人ke5315309003]

Bbs1
本版专家分:7
结帖率 93.33%
Bbs1
本版专家分:7
Bbs6
本版专家分:5324
Bbs1
本版专家分:7
Bbs7
本版专家分:22734
Blank
微软MVP 2011年1月 荣获微软MVP称号
Bbs8
本版专家分:35356
版主
Blank
银牌 2012年1月 总版技术专家分月排行榜第二
Blank
微软MVP 2014年7月荣获微软MVP称号
2013年7月 荣获微软MVP称号
2012年7月 荣获微软MVP称号
2011年7月 荣获微软MVP称号
Blank
铜牌 2012年2月 总版技术专家分月排行榜第三
Blank
红花 2012年11月 社区支持大版内专家分月排行榜第一
2012年2月 MS-SQL Server大版内专家分月排行榜第一
2012年1月 MS-SQL Server大版内专家分月排行榜第一
2011年5月 挨踢职涯大版内专家分月排行榜第一
2009年6月 企业开发大版内专家分月排行榜第一
2009年4月 企业开发大版内专家分月排行榜第一
Bbs2
本版专家分:261
Bbs3
本版专家分:588
Bbs1
本版专家分:7
Bbs1
本版专家分:7
Bbs7
本版专家分:22734
Blank
微软MVP 2011年1月 荣获微软MVP称号
Bbs1
本版专家分:7
Bbs1
本版专家分:7
Bbs5
本版专家分:2292
Bbs14
本版专家分:816156
Blank
名人 2012年 荣获名人称号
Blank
状元 2010年 总版技术专家分年内排行榜第一
2009年 总版技术专家分年内排行榜第一
Blank
榜眼 2011年 总版技术专家分年内排行榜第二
Blank
金牌 2011年3月 总版技术专家分月排行榜第一
2011年2月 总版技术专家分月排行榜第一
2011年1月 总版技术专家分月排行榜第一
2010年12月 总版技术专家分月排行榜第一
2010年11月 总版技术专家分月排行榜第一
2010年10月 总版技术专家分月排行榜第一
2010年9月 总版技术专家分月排行榜第一
2010年8月 总版技术专家分月排行榜第一
2010年7月 总版技术专家分月排行榜第一
2010年6月 总版技术专家分月排行榜第一
2010年5月 总版技术专家分月排行榜第一
2010年3月 总版技术专家分月排行榜第一
2010年4月 总版技术专家分月排行榜第一
2010年2月 总版技术专家分月排行榜第一
2010年1月 总版技术专家分月排行榜第一
2009年12月 总版技术专家分月排行榜第一
2009年11月 总版技术专家分月排行榜第一
2009年10月 总版技术专家分月排行榜第一
2009年8月 总版技术专家分月排行榜第一
2009年7月 总版技术专家分月排行榜第一
2009年6月 总版技术专家分月排行榜第一
分页分页分页分页分页分页分页分页出错
rn下面是我写的程序,但出现了下面错误,请帮忙改正rnrnrnIE提示:rn错误类型:rnADODB.Recordset (0x800A0E78)rn对象关闭时,不允许操作。rn/manna/information/information-esh3.asp, 第 29 行rnrnrnrnrnrnrnrn 实现<em>分页</em>|选择<em>分页</em>rn rnrnrnrs.pagecount then page=rs.pagecountrnrnrs.Absolutepage=pagern%>rn rn rn<>1 then%>rn首页rn上一页rnrn<>rs.pagecount then%>rn下一页rn未页rnrn 当前第页,共页,转到:rn 页rnrnrnrn rn rn rn 编号rn rn rn 用户名rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn<>1 then%>rn首页rn上一页rnrn<>rs.pagecount then%>rn下一页rn未页rnrn 当前第页,共页,转到:rn 页rnrnrnrnrnrnrn
分页出错
就是把前一页的内容在后一页列出来,之后才列新的内容。如rnrn本来应该是这样的rn第一页rnarn第二页rnbrn第三页rnbrnrn变成rn第一页rnarn第二页rnabrn第三页rnabc
分页出错!!
如何解决?谢谢!rnrnApache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Errorrnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage Internal Server Errorrnrndescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.rnrnexception rnrnjavax.servlet.ServletException: Result set type is TYPE_FORWARD_ONLYrn at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)rn at org.apache.jsp.index$jsp._jspService(index$jsp.java:662)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)rn at java.lang.Thread.run(Thread.java:534)rnrnrnroot cause rnrnjava.sql.SQLException: Result set type is TYPE_FORWARD_ONLYrn at sun.jdbc.odbc.JdbcOdbcResultSet.last(JdbcOdbcResultSet.java:2293)rn at org.apache.jsp.index$jsp._jspService(index$jsp.java:189)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)rn at java.lang.Thread.run(Thread.java:534)rnrn
分页出错
ADODB.Field 错误 '80020009' rnrnBOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。 rnrnrnrnrnrn 按书名查询rnrnrnrnrn rn rn rn 分类号rn 正题名rn rnrnrnrnrnrnrnrn rn rn rn rn >rn rn rn rnrnrnrn rn rn rn rnrnrnrnrnrnrnrn
分页出错??
小弟刚学ASP.NET,在datagrid<em>分页</em>的时候卡住了。rn页面能够正常显示记录,并显示1 2 3 4页码,但是点击页码不能跳转,就在cs里面加了以下代码:rnrnprivate void PageChange(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)rn rn dgrdCollege.CurrentPageIndex=e.NewPageIndex; rnrn datagrid_Load();rn rnrn报错:重载"datagrid_Load"方法未获取“0”参数rnrn该如何解决,望赐教!
不难问题???
a=server.urlencode("我们的大中国")rn将a存入数据库,请问如何将其正确读出??
不难问题
怎么把本网页的文本框的内容赋值给一个变量,例如List.asp中有两个文本框Name分别是“T1”和“T2”,要把它们赋值给变量A1和A2,该怎么才能实现呢???
问题不难
请问tcp/ip上有一段地址,在internet上不被使用,好象是196.?.?.?,请问到底是多少,谢
不难问题
Documents and Settings目录里All Users和Default User里的配置文件有何区别?
PHP搜索特定页面关键词问题!这个问题不难?难!不难!难?不难?难!不难!难?不难?难!不难!难?不难?难!不难!难?不难?……
给定一个网页parent.htm,在此网页上有N(N<30)个超链接,超链接指向的页面分别是son1.htm, son2.htm,...,sonN.htm.rn那么,怎么根据指定的parent.htm找到son1.htm, son2.htm,...,sonN.htm上的关键字(keyword) ?
不难问题!!!
请问一个很长的数相除怎么做呀?rn 比喻i=123456789,j=456123789rn j相除以irn
不难问题.
建了这样一个变量rnvar tree = document.createElement("DIV");rn多次调用了tree.appendChild(); 往里面加了很多东西,我现在想看看里面有哪些元素,应该怎样?rnalert(tree.什么?);
Datagrid分页后的出错问题
Datagrid<em>分页</em>后,添加纪录每当增加一个页面时,总是会<em>出错</em>rn例如:本来共有两页(记录已满),添加一个记录后,会显示有5页,rn 而点击第4页或第5页就会<em>出错</em>,请问如何修正?
关于struts+jdbc分页 出错问题
String sql = "SELECT TOP 15 * FROM zlb_lgz_hxcf WHERE ID NOT IN(SELECT TOP "+"15*(pageInfoVO.getPageIndex()-1)"+" ID FROM zlb_lgz_hxcf)";rnstmt = con.prepareStatement(sql);rnstmt.setInt(1, (pageInfoVO.getPageIndex()-1)*pageInfoVO.getRows());rnstmt.setInt(2, pageInfoVO.getRows());rn
ext grid分页出错问题
我要做ext grid<em>分页</em>,按例子做一直做不出来,在firebug上显示错误如下:rn[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: javascript: eval(__firebugTemp__); :: anonymous :: line 1" data: no]rnrn而且好像没用调用到HttpProxy中设置的action. HttpProxy设置的url为:./adminList.do 我的js文件目录在\WebRoot\js\jsfile\中,名为superAdminConsole.js, 我的action的path为/adminList .这样设置HttpProxy的url应该没有错吧,而且我也设置过../adminList.do或者是/adminList.do和adminList.do,结果都不行. 只要把store加到grid上就报上面的错,而且后台并没有显示调用到action中的方法. rnrn具体代码如下:rnsuperAdminConsole.js (节选与grid相关的):rn[code="java"]rn var AdminRecord = new Ext.data.Record.create([rn name:'id',rn name:'username',rn name:'realname',rn name:'gender',rn name:'role',rn name:'department'rn ]);rn rn var adminReader = new Ext.data.JsonReader(rn totalProperty:"results",rn root:"rows",rn id:"id"rn ,AdminRecord);rn rn var adminStore = new Ext.data.JsonStore(rn proxy:new Ext.data.HttpProxy(url:'./adminList.do'),rn reader:adminReaderrn );rn rn //执行这句时<em>出错</em>的rn adminStore.load(params:start:0,limit:10);rnrn //Admin列表rn var adminListGrid = new Ext.grid.GridPanel(rn title:"Admin列表",rn height:380,rn columns:[new Ext.grid.RowNumberer(),rn header:"Id",dataIndex:"id",sortable:true,hidden:true,rn header:"用户名",dataIndex:"username",sortable:true,rn header:"真实姓名",dataIndex:"realname",sortable:true,rn header:"性别",dataIndex:"gender",renderer:showGender,rn header:"角色",dataIndex:"role",rn header:"部门",dataIndex:"department",sortable:true],rn store:adminStore,rn bbar:new Ext.PagingToolbar(rn pagesize:10,rn store:adminStore,rn displayInfo:true,rn displayMsg:'显示第0到1条数据,共2条',rn emptyMsg:"没有数据",rn beforePageText:"第",rn afterPageText:'页 共0页'rn )rn );rn[/code]rnrnadminList.do 文件:rn[code="java"]rn public ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rn SuperAdminBean superAdmin = (SuperAdminBean)request.getSession().getAttribute("person");rn rn String start = request.getParameter("start");rn String limit = request.getParameter("limit");rn System.out.println(start + " " + limit);rn JSONObject json = null;rn try rn int index = Integer.parseInt(start);rn int pageSize = Integer.parseInt(limit);rn List adminList = superAdmin.listCustomersByRole("Admin");rn json = JSONUtil.toJSONForPage(adminList,0,10);rn //为了显示是否输入正确的json. rn System.out.println(json.toString());rn response.getWriter().write(json.toString()); rn catch(Exception ex) rn rn return null;rn rnrn输出的json为:rn"results":21,"rows":["department":"市场部","gender":"male","id":2,"post":"","realname":"leikai","role":"Admin","username":"lk","department":"市场部","gender":"male","id":4,"post":"","realname":"leikai1","role":"Admin","username":"lk1","department":"技术部","gender":"male","id":5,"post":"","realname":"leikai2","role":"Admin","username":"lk2","department":"人事部","gender":"male","id":6,"post":"","realname":"leikai3","role":"Admin","username":"lk3","department":"财务部","gender":"male","id":7,"post":"","realname":"leikai4","role":"Admin","username":"lk4","department":"市场部","gender":"male","id":8,"post":"","realname":"leikai5","role":"Admin","username":"lk5","department":"人事部","gender":"male","id":9,"post":"","realname":"leikai6","role":"Admin","username":"lk6","department":"技术部","gender":"male","id":10,"post":"","realname":"leikai7","role":"Admin","username":"lk7","department":"人事部","gender":"male","id":11,"post":"","realname":"leikai8","role":"Admin","username":"lk8","department":"人事部","gender":"male","id":12,"post":"","realname":"leikai9","role":"Admin","username":"lk9"]rn[/code]rnrn请大家帮我看看!
菜菜问题 分页代码出错
以下是代码: 把request那句话去掉,就好使,加上就不好用,问各位大虾那句话有什么错误吗? rnrn rnrnrnrnrn 俺刚学jsprnrnrn rn rnrn allpage) rn cpage=1; rn else rn cpage=pages; rn rnrn //判断起始记录rn spage=(cpage-1)*ipage; rn%>rnrn rn rn rn rn rn rn rnrnrn>上一页 rn>下一页rnrnrn
sqlserver2000 分页存储过程 出错问题
create procedure pagination rn(rn@startIndex int,rn@endIndex int,rn@docount bit,rn@tableName varchar(50),rn@order varchar(50),rn@where varchar(1000)rn)rnasrnset nocount onrnif(@docount=1)rnselect count(*) from "+@tableName+"rnelsernbeginrndeclare @indextable table(id int identity(1,1),nid int)rnset rowcount @endIndexrninsert into @indextable(nid) select * from "+@tableName+" order by "+@order+"rnselect * from "+@tableName+" o,@indextable t where "+@where+" rnand t.id between @startIndex and @endIndex order by t.idrnendrnrnrnrnrnrn以上是我用<em>分页</em>控件生成的存储过程,但是我改过之后,就出现<em>问题</em>了,不知道为什么<em>出错</em>,哪位大虾帮我看下!rnset nocount off
分页问题,rs.absolutepage=page 出错
错误:变量或类型不正确,或者不在可以接受的范围之内,要不就是与其它数据冲突rnrn
不难的!
我在窗体中用POPUPMENU时为什么老是菜单为谈到别的地方去,是不是要转换为屏幕坐标,怎么转换?
不难
怎么样利到计算机的可用端口?
不难
如果用代码执行SQL SERVER7中的DTS包!
不难不难,进来看看!
#define USING_0 using 0rnvoid MyFunc(...) USING_0rnrn...rnrn请问各大侠,将USING_0加在一个函数实现的后面,是什么意思。rn这个好象是个C语法的东东,不过在下实在不知了,请赐教。
权限问题(送分20),不难 只是我不会
<em>问题</em>描述如下:rnrn安全性异常 rn说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。 rnrn异常详细信息: System.Security.SecurityException: 不允许所请求的注册表访问权。rnrn源错误: rnrnrn行 26: private void LogEvent(string message) rn行 27: if (!EventLog.SourceExists("ThePhile.COM")) rn行 28: EventLog.CreateEventSource("ThePhile.COM", "Application");rn行 29: rn行 30: EventLog.WriteEntry("ThePhile.COM", message, EventLogEntryType.Error);rnrn我应该怎么做,最好讲详细一点。rn rn
求解一个存储过程怎么写,应该不难的,我只是菜鸟
我想问一个存储过程的中间处理<em>问题</em>,表的设计可能不太合理,<em>只是</em>为方便阐述<em>问题</em>。rnrn学生表rnstudent(id)rnid rn001 rn002 rn003 rnrn成绩表rnscore(id,score,sub)rnid score subrn001 80 englishrn002 90 englishrn001 81 mathrn002 91 mathrnrn注:003没有参加考试rnrn首先我想求出score表里每个学生各自的总成绩,及成绩最高的一门rn[code=SQL]rncreate procedure AAArnas rnbeginrnselect id, sum(score) as sum_score,max(score) as max_score from score group by idrn结果应该是rnid sum_score max_score rn001 161 81rn002 181 91rnrn<em>问题</em>来了,我想接下来在这个结果集的基础得到这样的结果(一定要在这个结果集的基础上)rnrnid sum_score max_score rn001 161 81rn002 181 91rn003 0 0rn那接下来要怎么写呀? 要循环,还是游标什么的吗?rn[/code]rn其实我就想知道,如果在存储过程中,如果第一次求出一个结果集了,能不能接下来马上再对这个结果集当成一个表或者视图一样来和其他表或者视图进行连接查询这样的。rnrnrnrnrnrn
高人指点几行代码不难,只是我不懂
我的这段代码可以编译但运行时结果是未初始化,不知为什么,谢谢。rnrnimport java.awt.*;rnimport javax.swing.*;rnrn/*rnrnrn*/rnrnpublic class boxlayout extends JAppletrnrn JPanel jpanels[];rn rn public void init()rn rn Container contentPane=getContentPane();rn contentPane.setLayout(new FlowLayout());rn rn jpanels=new JPanel[2];rn rn for(int i=0;i));rn rn contentPane.add(jpanels[i]);rn rn rn jpanels[0].setLayout(new BoxLayout(jpanels[0],BoxLayout.Y_AXIS));rn jpanels[1].setLayout(new BoxLayout(jpanels[1],BoxLayout.X_AXIS));rn jpanels[2].setLayout(new BoxLayout(jpanels[2],BoxLayout.Y_AXIS));rn rn
datagrid自定义分页取值不完全(问题不难,但郁闷)
以下代码运行后只显示记录的前六条,就是datagrid只显示1 2 两页(应该显示1 2 3 4),pagesize我设置为3(数据库中有12条记录,并且id 是连续的),且翻页事件也执行,我把希望寄托在各位仁兄身上了!!! 看看到底那有<em>问题</em>???rnrnpublic partial class _Default : System.Web.UI.Pagernrnrn public int intEndIndex, intStartIndex;rn protected void Page_Load(object sender, EventArgs e)rn rn if (!Page.IsPostBack)rn rn OleDbConnection con = new OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);rn string strSelect = "select count(*) from big_category";rn OleDbCommand cmd = new OleDbCommand(strSelect, con);rn con.Open();rn etw_p.VirtualItemCount = ((int)cmd.ExecuteScalar() / etw_p.PageSize);rn //这里得到值为4; etw_p.VirtualItemCount=4 但就是不显示!rn con.Close();rn BindProduct();rn rn rn protected void BindProduct()rn rn OleDbConnection constring = new OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);rn DataSet ds = new DataSet();rn intEndIndex = intStartIndex + etw_p.PageSize;rn string sql = "select * from big_category where category_id > @startIndex and category_id ].DefaultView;rn etw_p.DataBind();rn rn protected void etw_p_PageIndexChanged(object source, DataGridPageChangedEventArgs e)rn rn intStartIndex = e.NewPageIndex * etw_p.PageSize;rn etw_p.CurrentPageIndex = e.NewPageIndex;rn BindProduct();rn rn
C高手请进(其实不难只是我没有转过弯)
南开大学出版的《二级教程C语言程序设计》P63例3.11:从一个整数x中右端第P位起取n位,得到一个新的数。rn算法如下:rn1.将x右移p-n+1位,使指定的n位移到最右端;rn2.取y=~0,使y为全1,将y左移n位,使其右端的n位为0而其余各位全为1;rn3.对移位后的y按位取反,这就使y最右端的各位全为1而其余位全为0;rn4.将x和y按位与(&),就可将x最右端的n位保留下来.rnrnrn我不明白的是:为什么将x右移p-n+1位,而不是右移p-n位,请高手赐教!rnrn比如: 十进制 712 ==>二进制1011001000,从右端第8位起取6位:rn 按以上算法结果应该是11001,这明明只有5位嘛. rn 按题意应该是110010才对!rn
紧急,明天的实验报告关于软中断,不难只是时间紧急。帮帮忙
rn软中断一rn编写一个程序循环输出“how are you?”,当键盘输入Ctrl+C时终止,当输出次数不超过350次时在此过程中使用Ctrl+C不能中断显示,350次后才能用Ctrl+C中断显示,然后输出“Byebye”.rnrn软中断二rn使用软中断实现父子进程同步,父进程先输出A,然后子进程输出B。rnrn软中断三rn编写程序完成:rn(1) 父进程生成两个子进程P1,P2rn(2) 父进程从键盘接收Ctrl+C中断信号rn(3) 然后父进程使用系统调用向两个子进程分别发送中止执行信号SIGUSR1和SIGUSR2rn(4) 子进程收到各自的信号后分别输出rn child 1 killed by father processrn child 2 killed by father process,并退出(无次序要求)rn(5) 父进程在收到子进程撤消的消息后输出rn father kill itself. 父进程最终退出。rnrn三个子进程和父进程的管道通信。rn编写一个程序,建立一个管道。同时,父进程生成子进程P1,P2,P3,这三个子进程分别向管道中写入消息(消息由键盘输入),父进程将消息读出。rnrnrn利用消息的4个系统调用编写消息发送接收程序。rn消息的创建、发送和接收。使用系统调用msgget( ),msgsnd( ),msgrev( ),及msgctl( )编制一长度为50字节的消息发送和接收的程序。rn
存储过程分页出错!为什么?
rnC#:rn private void bind(int PageIndex)rn rn string sql = "flag='0'";rn int PageSize = Convert.ToInt16(DBConfig.PageSize);rn DataSet ds = new DataSet();rn DB.OpenConnection();rn SqlCommand cmd = new SqlCommand("sp_All_Pager2", DBConfig.cn);rn cmd.CommandType = CommandType.StoredProcedure;rn SqlCommandBuilder.DeriveParameters(cmd);rn cmd.Parameters["@tblName"].Value = "HR";rn cmd.Parameters["@fldNames"].Value = "id,name";rn cmd.Parameters["@fldNames2"].Value = "(SELECT pid FROM HR2 WHERE (HRid = tmpTable.id)) AS pid";rn cmd.Parameters["@fldOrderName"].Value = "id";rn cmd.Parameters["@orderType"].Value = 0;rn cmd.Parameters["@PageIndex"].Value = PageIndex;rn cmd.Parameters["@PageSize"].Value = PageSize;rn cmd.Parameters["@strWhere"].Value = sql;rn cmd.Parameters["@totalCount"].Direction = ParameterDirection.Output;rn SqlDataAdapter dp = new SqlDataAdapter();rn dp.SelectCommand = cmd;rn dp.Fill(ds, "hrdocmi");rn int PageCount;rn int RecordCount = Convert.ToInt32(cmd.Parameters["@totalCount"].Value);rn if (RecordCount == 0)rn rn PageCount = 1;rn rn elsern rn if (RecordCount % PageSize == 0)rn PageCount = RecordCount / PageSize;rn elsern PageCount = RecordCount / PageSize + 1;rn rn this.PageNavigator1.PageCount = PageCount;rn this.PageNavigator1.PageIndex = PageIndex;rn this.PageNavigator1.RecordCount = RecordCount;rn Repeater1.DataSource = ds.Tables[0];rn Repeater1.DataBind();rn ds.Clear();rn dp.Dispose();rn DB.CloseConnection();rn
mybatis分页 出错
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: ORA-00933: SQL 命令未正确结束rnrn### The error may exist in com/aspn/emp/dao/EmpMapper.xml rnrn### The error may involve defaultParameterMaprnrn### The error occurred while setting parametersrnrn### Cause: java.sql.SQLException: ORA-00933: SQL 命令未正确结束 rn​rnrn at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) rnrn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)rnrn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95)rnrn at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:124)rnrn at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:90)rnrn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)rnrn at $Proxy7.getEmpListPage(Unknown Source)rnrn at com.aspn.dept.dao.test.TestDao.testEmpByDept1(TestDao.java:41)rnrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnrn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rnrn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rnrn at java.lang.reflect.Method.invoke(Method.java:623)rnrn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)rnrn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rnrn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)rnrn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rnrn at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)rnrn at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)rnrn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)rnrn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)rnrn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)rnrn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)rnrn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)rnrn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)rnrn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)rnrn at org.junit.runners.ParentRunner.run(ParentRunner.java:300)rnrn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rnrn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rnrn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rnrn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rnrn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rnrn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnrnCaused by: java.sql.SQLException: ORA-00933: SQL 命令未正确结束 rn​rnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111) rnrn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)rnrn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)rnrn at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)rnrn at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:212)rnrn at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:795)rnrn at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1030)rnrn at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:835)rnrn at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1123)rnrn at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)rnrn at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3328)rnrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnrn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rnrn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rnrn at java.lang.reflect.Method.invoke(Method.java:623)rnrn at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:51)rnrn at $Proxy11.executeQuery(Unknown Source)rnrn at com.aspn.page.util.PagePlugin.intercept(PagePlugin.java:68)rnrn at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:57)rnrn at $Proxy9.prepare(Unknown Source)rnrn at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:70)rnrn at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56)rnrn at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)rnrn at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:141)rnrn at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)rnrn at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)rnrn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101)rnrn ... 30 more rn​rnrn rnrndebug时rnrn设置时好像<em>出错</em>了rnrn跟中一下后 发现 下面的params是nullrnrn导致 ResultSet rs = (ResultSet) method.invoke(statement, params);<em>出错</em>rnrn为啥params null啊?rnrn rnrn public Object invoke(Object proxy, Method method, Object[] params) throws Throwable rnrn try rnrn if (EXECUTE_METHODS.contains(method.getName())) rnrn if (isDebugEnabled()) rnrn debug("==> Parameters: " + getParameterValueString());rnrn rnrn clearColumnInfo();rnrn if ("executeQuery".equals(method.getName())) rnrn ResultSet rs = (ResultSet) method.invoke(statement, params);rnrn if (rs != null) rnrn return ResultSetLogger.newInstance(rs, getStatementLog());rnrn else rnrn..rnrn..rn
执行分页出错!......................................................................
执行<em>分页</em>时<em>出错</em>!rn<em>出错</em>信息如下:rn指定的参数已超出有效值的范围。参数名: index rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围。参数名: indexrnrn源错误: rnrnrn行 166: // 取得按钮所在列之「货号」...等字段的内容rn行 167: string hhid = e.Item.Cells[0].Text;rn行 168: string hm = e.Item.Cells[1].Text;rn行 169: int zjs = System.Convert.ToInt32(e.Item.Cells[2].Text);rn行 170: int ktzjs = System.Convert.ToInt32(e.Item.Cells[3].Text);rn rnrn源文件: c:\inetpub\wwwroot\56glxt\addth.aspx.cs 行: 168 rn
DataGrid分页出错
我用DataGrid<em>分页</em>,PageLoad的时候显示正常,但是点击“下一页”的时候,DataGrid显示为空白,检查了N久都找不到原因。。。。。rnrn代码:rn private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rn if(!IsPostBack)rn rn ShowDataGrid();rn rn rnrn public void ShowDataGrid()rn rn string con=ConfigurationSettings.AppSettings["dsn"];rn SqlConnection conn = new SqlConnection(con);//连接字符串rn conn.Open();rn       rn SqlDataAdapter myCommand = new SqlDataAdapter();  //创建SqlDataAdapter 类rn   myCommand.SelectCommand=new SqlCommand("selectKjxxkByClass",conn);rn myCommand.SelectCommand.CommandType=CommandType.StoredProcedure ;rn SqlParameter classname=myCommand.SelectCommand.Parameters.Add("@classname",SqlDbType.Char,200);rn classname.Value =1;rn rn DataSet ds=new DataSet(); //建立并填充数据集rn myCommand.Fill(ds,"Article");rn rn kjxxkDataGrid.DataSource=ds;rn kjxxkDataGrid.DataBind();rn conn.Close();rn rnrn public void ChangePage(object sender,DataGridPageChangedEventArgs e)rn rn kjxxkDataGrid.CurrentPageIndex = e.NewPageIndex;rn ShowDataGrid();rn
Gribview分页加载数据出错
重复加载,加载完最后一条数据应该给 "没有更多数据了....";但运行程序,确是加载完最后一条数据之后再次从头开始加载数据rnrn[code=java]rnpublic class ClassActivity extends Activity implements OnClickListener rnprivate GridView gv;rnprivate ImageView imageView;rnprivate String classid;rnprivate int count=1;rnList> lists = new ArrayList>();rnprivate boolean is_divpage; rnprivate ClassTypeAdapter adapter;rnString url="http://192.168.11.2:8080/class-activity-img-type.html?pageLines=4&classId="+Class_ID.getClass_ID()+"&pageNo=";rnrnrn@Overridernprotected void onCreate(Bundle savedInstanceState) rnsuper.onCreate(savedInstanceState);rnsetContentView(R.layout.classimage);rnrnrnrngv=(GridView) findViewById(R.id.gridView1);rnimageView=(ImageView) findViewById(R.id.imageView1);rnadapter=new ClassTypeAdapter(this);rnrnrnnew DownloadTask().execute(url,Integer.toString(count));rnrnbtnActivicon.setOnClickListener(this);rnbtnIntro.setOnClickListener(this);rnbtnCulture.setOnClickListener(this);rnbtnWork.setOnClickListener(this);rnimageView.setOnClickListener(this);rnrnrngv.setOnScrollListener(new OnScrollListener() rnrn@Overridernpublic void onScrollStateChanged(AbsListView view, int scrollState) rn// TODO Auto-generated method stubrnif(is_divpage && scrollState==OnScrollListener.SCROLL_STATE_IDLE)rnToast.makeText(ClassActivity.this, "获取数据", 1).show();rnnew DownloadTask().execute(url,Integer.toString(count));rnrnrnrn@Overridernpublic void onScroll(AbsListView view, int firstVisibleItem,rnint visibleItemCount, int totalItemCount) rn// TODO Auto-generated method stubrnis_divpage = (visibleItemCount + firstVisibleItem == totalItemCount);rnrn);rnrngv.setOnItemClickListener(new OnItemClickListener() rnrnrn@Overridernpublic void onItemClick(AdapterView parent, View view,rnint position, long id) rn// TODO Auto-generated method stubrnGridView gridView=(GridView) parent;rnHashMap map = (HashMap) rngridView.getItemAtPosition(position);rnString type=map.get("type");rnIntent intent_A=new Intent(ClassActivity.this,ClassView.class);rnintent_A.putExtra("ClassImgType", type);rnstartActivity(intent_A);rnrn);rnrnrnclass DownloadTask extends AsyncTask>> rnrnrn@Overridernprotected List> doInBackground(String... params) rn// TODO Auto-generated method stubrnrnList> list = new ArrayList>();rnHashMap map;rnHttpClient client = new DefaultHttpClient();rnHttpGet get = new HttpGet(params[0] + params[1]);rntry rnHttpResponse response = client.execute(get);rnif (response.getStatusLine().getStatusCode() == 200) rnSystem.out.println("联网成功");rnString jsonData = EntityUtils.toString(response.getEntity(), "UTF-8");rntry rnJSONArray jsonArray = new JSONArray(jsonData);rnif (!jsonArray.isNull(0)) rnfor (int i = 0; i < jsonArray.length(); i++) rnJSONObject object = jsonArray.getJSONObject(i);rnrnString type = object.getString("type");rnString title=object.getString("title");rnString img = object.getString("indexImg");rnString photo = object.getString("img");rnString date =object.getString("operationTime");rnmap = new HashMap();rnmap.put("type", type);rnmap.put("title", title);rnmap.put("indexImg", img);rnmap.put("img", photo);rnmap.put("operationTime", date);rnlist.add(map);rnrnrnreturn list;rnrn rncatch (JSONException e) rn// TODO Auto-generated catch blockrnrnrnrn catch (ClientProtocolException e) rn// TODO Auto-generated catch blockrne.printStackTrace();rn catch (IOException e) rn// TODO Auto-generated catch blockrne.printStackTrace();rnrnSystem.out.println("---1-" + list.size());rnreturn list;rnrnrn@Overridernprotected void onPostExecute(List> result) rn// TODO Auto-generated method stubrnsuper.onPostExecute(result);rnif (result.size() > 0) rnlists.addAll(result);rnadapter.setData(lists);rnif (count == 1) rngv.setAdapter(adapter);rnrnadapter.notifyDataSetChanged();rncount++;rn else rnToast.makeText(getApplicationContext(), "没有更多数据了....", 0).show();rnrnrnrn@Overridernprotected void onPreExecute() rn// TODO Auto-generated method stubrnsuper.onPreExecute();rnrnrnrn[/code]
【求助】分页出错
[code=C#] public static DataTable TotalArticle(int currentPage)rn rn SqlConnection conn=dataLink.DbConnet();rn SqlCommand cmd=conn.CreateCommand();rn cmd.CommandType=CommandType.StoredProcedure;rn cmd.CommandText="TotalArticle";rn cmd.Parameters.Add("@currentPage",currentPage);rn SqlDataAdapter da=new SqlDataAdapter(cmd);rn DataSet ds=new DataSet();rn tryrn rn da.Fill(ds);rn da.Dispose();rn rn catchrn rn ds=null;rn rn finallyrn rn conn.Close();rn rn return ds.Tables[0];rn [/code]rnrncurrentPage 为1时 这段代码没<em>问题</em>,rn但当currentPage为2,3,4...时 就出现:System.NullReferenceException: 未将对象引用设置到对象的实例。rn我的<em>分页</em>为每页显示20个记录,哪里错了!难道只能显示第一页,奇怪了,SQL语句 存储过程 没有<em>问题</em>的。
求助.分页代码出错!
数据库里一共有19条记录,rn我打算每页显示6条记录,这样的话,按理说应该会分成4页,但运行的时候却发现只分成了2页,rn错误如下图演示rn[img=http://sztym.xvip209.asccf.com/jl/fy.gif][/img]rn我的代码是这样的:rn[code=PHP]rnrn<>""thenrnSql="Select*fromQianbo_Productswhereid="&id&"andCommendFlag=Trueorderbyiddesc"rnElsernSql="Select*fromQianbo_Productsorderbyiddesc"rnEndIFrnrs.opensql,conn,1,1rnifrs.eofandrs.bofthenrnResponse.Write"还没有任何产品。"rnelsernnum=rs.recordcountrnpagenum=rs.pagecountrncurrentpage=request("page")rn'判断页码开始rnIfpage<>""thenrnpage=cint(page)rniferr.number<>0thenrnerr.clearrnpage=1rnendifrnifpagenumandnot((page-1)*rs.pagesizetotalputthenrnif(totalPutmodMaxPerPage)=0thenrncurrentpage=totalPut\MaxPerPagernelserncurrentpage=totalPut\MaxPerPage+1rnendifrnendifrnifcurrentPage=1thenrnshowContentrnshowpagetotalput,MaxPerPage,"products.asp"rnelsernif(currentPage-1)*MaxPerPagernrnrnrn rn rn " target=_blank>" width=200 vspace=5>rnrn rn " target=_blank> rnrnrnrnMaxPerPagethenexitdornloop%>rnrnrnrn rn共有 个产品| 首页 | 1 then%>> 上一页 | 0 then%>> 下一页 | 1>尾页 |页次:/页 |共页rn[/code]rnrn朋友们帮我看看是哪里<em>出错</em>好吗?rn谢谢了
JAVABEAN分页出错 帮帮我
type Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperExceptionrn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rn filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)rnrnrnroot cause rnrnjava.lang.NullPointerExceptionrn org.apache.jsp.contact_jsp._jspService(contact_jsp.java:79)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rn filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)rnrnrnnote The full stack trace of the root cause is available in the Tomcat logs.rnrnrnrnrnrnrnrnrnrn Lomboz JSPrnrnrnrnrnrn rnrnrnrn rnrn每页行rn共行rn第页rn共页rn rn rn 首页rn 上一页rnrn rn下一页rn尾页rnrn转到第rnrn >rnrn >rn rn 页rnrnrnrnrnrnrnrnrnrnrnrnrnrnrnrnpackage mybook;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnrnpublic class JDBCBOOK rn rn public static Connection getConnection()rn rn Connection con=null;rn rn String Classforname="com.microsoft.jdbc.sqlserver.SQLServerDriver";rn String Servanddb="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=book";rn String User="sa";rn String Pwd="sa";rn rn tryrn rn Class.forName(Classforname);rn con = DriverManager.getConnection(Servanddb,User,Pwd);rn rn catch(Exception e)rn rn e.printStackTrace();rn rn return con;rn rnrnrnrnrnrnrnrnpackage mybook;rnimport java.util.Vector;rnrnrnpublic class Page rnrn public int curpage;rn public int maxpage;rn public int maxrowcount;rn public int rowsperpage=5;rn public Vector data;rn rn public Page()rn rn rn rnrn public void countmaxpage()rn rn if(this.maxrowcount % this.rowsperpage==0)rn rn this.maxpage=this.maxrowcount/this.rowsperpage;rn rn elsern rn this.maxpage=this.maxrowcount/this.rowsperpage+1;rn rn rn rn public Vector getResult()rn rn return this.data;rn rn rn public Page(Contact contact)throws Exceptionrn rn this.maxrowcount=contact.getAvailablecount();rn this.data=contact.getResult();rn this.countmaxpage();rn rnrnrnrnrnrnrnpackage mybook;rnrnimport java.sql.Connection;rnimport java.sql.ResultSet;rnimport java.sql.Statement;rnimport java.util.Vector;rnrnpublic class Contact rnrn private Connection con;rn Vector v;rn rn public Contact()throws Exceptionrn rn this.con=JDBCBOOK.getConnection();rn v = new Vector();rn rn rn public int getAvailablecount()throws Exceptionrn rn int ret=0;rn Statement stmt=con.createStatement();rn String strSql="select count(*) from info";rn ResultSet rset=stmt.executeQuery(strSql);rn while(rset.next())rn rn ret=rset.getInt(1);rn rn return ret;rn rn rn rn public Page listData(String pages)throws Exceptionrn rn tryrn rn Page page=new Page(this);rn int pagenum=Integer.parseInt(pages);rn Statement stmt=con.createStatement();rn rn String strSql="select top " + pagenum*page.rowsperpage + "* from info order by info_id";rn ResultSet rset=stmt.executeQuery(strSql);rn int i=0;rn while(rset.next())rn rn if(i>(pagenum-1)*page.rowsperpage-1)rn rn Object[] obj = new Object[5];rn obj[0]=new Integer(rset.getInt("info_id"));rn obj[1]=rset.getString("info_type");rn obj[2]=rset.getString("info_title");rn obj[3]=rset.getString("info_content");rn obj[4]=rset.getDate("info_time");rn v.add(obj);rn rn i++;rn rn rn rset.close();rn stmt.close();rn page.curpage=pagenum;rn page.data=v;rn return page;rn rn catch(Exception e)rn rn e.printStackTrace();rn throw e;rn rn rn rn public Vector getResult()throws Exceptionrn rn return v;rn rnrnrnrnrnrnrnrnpackage mybook;rnrnimport java.io.IOException;rnimport java.io.PrintWriter;rnrnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnrnpublic class ContactServlet extends HttpServlet rnrn protected void doGet(HttpServletRequest request,rn HttpServletResponse response) throws ServletException, IOException rn rn response.setContentType("text/html");rn PrintWriter out = response.getWriter();rn tryrn rn Contact contact = new Contact();rn Page pages=contact.listData((String) request.getParameter("pages"));rn request.setAttribute("pages",pages);rn rn catch(Exception e)rn rn e.printStackTrace();rn rn javax.servlet.RequestDispatcherrn dis=request.getRequestDispatcher("/viewcontact");rn dis.forward(request,response);rn rnrn protected void doPost(HttpServletRequest request,rn HttpServletResponse response) throws ServletException, IOException rn rn doGet(request,response);rn rnrn
求助,分页功能出错!
我把一个整站系统Access数据库转为SQL,我只改了数据库连接部分代码,原来Access表里面自动添加ID的字段,我也改为标识种子递增为1.可是所有有<em>分页</em>部分的代码都<em>出错</em>了,地点在代码call showpagesrncall list部分,类型如下:rn错误类型:rnMicrosoft VBScript 运行时错误 (0x800A000D)rn类型不匹配: 'showpages'rn/1/News.asp, 第 174 行rnshowpages函数如下:rnsub showpages() rndim n rnif (totalPut mod MaxPerPage)=0 then rnn= totalPut \ MaxPerPage rnelse rnn= totalPut \ MaxPerPage + 1 rnend if rnif n=1 then rnresponse.write "留言簿管理界面" rn rnexit sub rnend if rndim k rnresponse.write " >> 留言<em>分页</em> " rnfor k=1 to n rnif k=currentPage then rnresponse.write "["+Cstr(k)+"] " rnelse rnresponse.write "["+""+Cstr(k)+"] " rnend if rnnext rnend sub rn我看了半天,不知道哪里跟数据库有关,<em>分页</em>功能是要先读数据表里面有几条记录赋值给totalPut是吗?rn类型不匹配是什么意思呢?还有有通用的比较好的<em>分页</em>代码吗?
oracle分页出错
以下是我的oracle<em>分页</em>的sql语句:rnString sql="SELECT * FROM (SELECT A.*, ROWNUM RN FROM (SELECT * FROM usr) A WHERE ROWNUM = 3" ;rnrn[color=#FF0000]如果把引号中的语句在oracle里边执行的话是可以执行的,但是放到程序中就显示错误:[/color]rnorg.apache.jasper.JasperException: Unable to compile class for JSP: rnrnAn error occurred at line: 117 in the jsp file: /role_manager.jsprnString literal is not properly closed by a double-quotern114: rn115: rn116: rn117: String sql="SELECT * FROM (SELECT A.*, ROWNUM RN FROM rn118: (SELECT * FROM usr) A WHERE ROWNUM rn119: = 3" ;rn120: rnrnrnStacktrace:rn org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)rn org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)rn org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrn跪求那位大虾帮忙解答一下,在此先道声xiexiern
分页功能出错
我在用Repeater和PagedDataSource做一个<em>分页</em>功能,在Repeater1.DataBind()处出现无法计算未实现 ICollection 的数据源中的计数这个错误。代码如下:rn DataSelectCourseDataContext db = new DataSelectCourseDataContext();rn var s = from c in db.tb_Coursern join t in db.tb_Teacher on c.teacherIDrn equals t.teaIDrn join sc in db.tb_StudyClass on c.courseIDrn equals sc.cousIDrn select newrn rn c.courseName,rn sc.studclassName,rn t.teaNamernrn ;rnrn PagedDataSource pds = new PagedDataSource();rn pds.DataSource = s;rn pds.AllowPaging = true;rn pds.AllowCustomPaging = false;rn pds.PageSize = 1;rn pds.CurrentPageIndex = currentpage - 1;rnrn Repeater1.DataSource = pds;rn Repeater1.DataBind();rnrn————————————————————————————————————————————————————————在pds.AllowPaging = true;后加上pds.AllowCustomPaging = true;后这个错误消失,但是页面运行后不能<em>分页</em>。rnpds.PageCount的值一直为1.求高手帮忙!rnrnrn
hirbernate分页出错
数据库中的是sqlserver2000rn[code=Java]Configuration con = new Configuration().configure();rn SessionFactory sf = con.buildSessionFactory();rn Session session = sf.openSession();rn Query q = session.createQuery("from UserBean ");rn q.setMaxResults(110);rn q.setFirstResult(100);rn List li = q.list();rn for(UserBean ub : li) rn System.out.println(ub.getName());rn [/code]rn这是写的测试rn[code=Java]Hibernate: rn selectrn top 210 userbean0_.pk_id as pk1_0_,rn userbean0_.f_name as f2_0_,rn userbean0_.f_money as f3_0_ rn fromrn t_money userbean0_rn2011-5-12 12:06:53 org.hibernate.type.NullableType nullSafeGetrn信息: could not read column value from result set: pk1_0_; Invalid column name pk1_0_.rn2011-5-12 12:06:53 org.hibernate.util.JDBCExceptionReporter logExceptionsrn警告: SQL Error: 0, SQLState: 07009rn2011-5-12 12:06:53 org.hibernate.util.JDBCExceptionReporter logExceptionsrn严重: Invalid column name pk1_0_.rnException in thread "main" org.hibernate.exception.SQLGrammarException: could not execute queryrn at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.hibernate.loader.Loader.doList(Loader.java:2216)rn at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)rn at org.hibernate.loader.Loader.list(Loader.java:2099)rn at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)rn at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)rn at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)rn at com.lovo.text.PageText.main(PageText.java:21)rnCaused by: java.sql.SQLException: Invalid column name pk1_0_.rn at net.sourceforge.jtds.jdbc.JtdsResultSet.findColumn(JtdsResultSet.java:906)rn at net.sourceforge.jtds.jdbc.JtdsResultSet.getInt(JtdsResultSet.java:910)rn at org.hibernate.type.IntegerType.get(IntegerType.java:28)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)rn at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1097)rn at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:565)rn at org.hibernate.loader.Loader.doQuery(Loader.java:701)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)rn at org.hibernate.loader.Loader.doList(Loader.java:2213)rn ... 8 more[/code]rn这是暴的错误,如果把q.setFirstResult(100);去掉的话就不会报错,但数据就是从第一条开始取的
存储过程 分页 Where 出错.
程序中副值就会<em>出错</em>rnda.SelectCommand.Parameters.Add("@SelectOrder", SqlDbType.VarChar, 200).Value = "Where 1=1";rn提示Where<em>出错</em>.rn但写在里面的却可以.rn@SelectWhere Varchar(500)='Where 1=1'rn不知道为何啊..rnrn[code=SQL]rnCREATE proc getdatasetrn@TableList Varchar(200)='*',--搜索表的字段,比如:’id,datatime,job‘,用逗号隔开rn@TableName Varchar(30)='Product_Table', --搜索的表名rn@SelectWhere Varchar(500)='Where 1=1',--搜索条件,这里不用写where,比如:job=’teacher‘and class='2'rn@SelectOrderId Varchar(20)='ProductID',--表主键字段名。比如:idrn@SelectOrder Varchar(200)='', --排序,可以使用多字段排序但主键字段必需在最前面.也可以不写,比如:order by class ascrn@intPageNo int=1, --页号rn@intPageSize int=10 ,--每页显示数rn@RecordCount int OUTPUT --总记录数(存储过程输出参数)rnas rn rndeclare @TmpSelect NVarchar(600) rndeclare @Tmp NVarchar(600) rnrnset nocount on--关闭计数rnrnset @TmpSelect = 'select @RecordCount = count(*) from '+@TableName+' '+@SelectWherernrnexecute sp_executesql rn@TmpSelect, --执行上面的sql语句rnN'@RecordCount int OUTPUT' , --执行输出数据的sql语句,output出总记录数rn@RecordCount OUTPUTrnrn if (@RecordCount = 0) --如果没有贴子,则返回零rn return 0rn rn /*判断页数是否正确*/rn if (@intPageNo - 1) * @intPageSize > @RecordCount --页号大于总页数,返回错误rn return (-1)rnset nocount off--打开计数rnif @SelectWhere != '' rnbeginrnset @TmpSelect = 'select top '+str(@intPageSize)+' '+@TableList+' from '+@TableName+' where '+@SelectOrderId+' not in(select top '+str((@intPageNo-1)*@intPageSize)+' '+@SelectOrderId+' from '+@TableName+' '+@SelectWhere +' '+@SelectOrder+') and '+@SelectWhere +' '+@SelectOrderrnendrnelsernbeginrnset @TmpSelect = 'select top '+str(@intPageSize)+' '+@TableList+' from '+@TableName+' where '+@SelectOrderId+' not in(select top '+str((@intPageNo-1)*@intPageSize)+' '+@SelectOrderId+' from '+@TableName+' '+@SelectOrder+') '+@SelectOrderrnendrnexecute sp_executesql @TmpSelectrnreturn(@@rowcount)rnGOrnrn[/code]
Asp分页代码出错
[code=VBScript]<>"" thenrn epage=cint(request("page"))rn if epagers.pagecount then epage=rs.pagecountrnelsernepage=1rnend ifrnrs.absolutepage=epagern%>rnrn " width="485" height="285">rnrn " width="235" height="285">rn rnrn &page=">PREV &page="> NEXT 共页rnrn[/code]rn敲了半天的代码,发现只能显示第一条记录,一旦点下一条就会提示数据库没有记录,实际上数据库里是有的,求解...
sqlserver分页出错
select * from (select *,ROW_NUMBER()over(order by ID desc) as num from DATA_COLLECTT) as t where num between >3 and 和 3 and <=6怎么写
为什么我的分页出错???
首页 rn 上一页 rn 下一页 rn 末页 rnrnrnrnrnrnrnrnprivate void PagerButton_Click(object sender, System.EventArgs e)rn rn //获得LinkButton的参数值rn String arg = ((LinkButton)sender).CommandArgument;rnrn // Response.Write("xxxxx");rn switch(arg)rn rn case ("next"):rn if (DataGrid1.CurrentPageIndex < (DataGrid1.PageCount - 1))rn DataGrid1.CurrentPageIndex ++;rn break;rn case ("prev"):rn if (DataGrid1.CurrentPageIndex > 0)rn DataGrid1.CurrentPageIndex --;rn break;rn case ("fist"):rn DataGrid1.CurrentPageIndex=0;rn break;rn case ("last"):rn DataGrid1.CurrentPageIndex = (DataGrid1.PageCount - 1);rn break;rn default:rn //本页值rn DataGrid1.CurrentPageIndex = Convert.ToInt32(arg);rn break;rn rn this.GetData();rn rnrn点击上一页 下一页 页面不动 怎么 让 下一页 激活此PagerButton_Click事件啊???
分页出错,请教一下!
代码如下:rnrnrnrnrnrnrn.rn.rn.rn. rn通知与通报rn.rn.rn.rn.rn <>"查询" then%>rn rn rn rn 机构代码rn rn rn rn 机构名称rn rnrn rn rn 机构地址rn rn rn rn rn 行政区划rn rn rn rn rn 经济行业rn rn rn rn rn rn rn rn rn rn rn rn rn rn <>"" thenrnsql=sql&" and jgdm like '%"&trim(request("jgdm"))&"%'"rnend ifrnif request("jgmc")<>"" thenrnsql=sql&" and jgmc like '%"&trim(request("jgmc"))&"%'"rnend ifrnif request("jgdz")<>"" thenrnsql=sql&" and jgdz like '%"&trim(request("jgdz"))&"%'"rnend ifrnif request("xzqh")<>"" thenrnsql=sql&" and xzqhmc like '%"&trim(request("xzqhmc"))&"%'"rnend ifrnif request("jjhy")<>"" thenrnsql=sql&" and jjhy like '%"&trim(request("jjhy"))&"%'"rnend ifrnrnrss.CacheSize=30rnrss.CursorType=1rnrss.open sql,conn rnrss.PageSize=16rnrss.AbsolutePage=pagenumrn%>rn 查询结果 rn rnrn rn rn 机构代码rn 机构名称rn 机构地址rn 行政区划rn 经济行业rn rn rn rn rn rn rn rn rn rn rn rnrn=rss.PageCount then 注:### <em>出错</em>提示行rn Response.Write " 下一页 "rn elsern Response.Write " 下一页 " rn end if rn rss.Closern set rss=nothing %>rn结果查出来以后,点下一页时就<em>出错</em>了,提示rnMicrosoft VBScript 运行时错误 错误 '800a01a8' rn缺少对象: 'pagenum' rn比较郁闷,不知道怎么回事,大侠帮忙看一下.rn
hibernate 分页出错
用hibernate+spring做的<em>分页</em>,点过几次后,就提示一个和页面不相关的action不能打开.rn<em>分页</em>代码:rnpublic List findPage(String hql,int first,int max)rn List result = new ArrayList(); rn Session sess = null;rn try rn log.error("=====find page in try=======");rn sess = (Session) getSession();rn// super.getSession();rn Query query = sess.createQuery(hql);rn query.setFirstResult(first); rn query.setMaxResults(max);rn// System.out.println("===========hql: " + hql);rn long date1 = new Date().getTime();rn result = query.list(); rn long date2 = new Date().getTime();rn log.error("========get page spend " + (date2-date1) + " seconds");rn catch(RuntimeException re) rn log.error("========exception========");rn re.printStackTrace(); rn finally rn if (sess != null) rn sess.close();rn log.error("==========session closed=========");rn rn rn最多的情况是从最后一页跳到第一页的时候<em>出错</em>.错误如图:rn[img=D:/1.bmp][/img]rn
简单的分页存储过程出错
[code=SQL]rnUSE [db_QiDi]rnGOrnrnif exists (select * from dbo.sysobjects where rnid = object_id(N'[dbo].ming')rnand OBJECTPROPERTY(id, N'IsProcedure') = 1)rndrop procedure [dbo].Trngorncreate proc mingrn(rn @pageSize int,rn @pageIndex int,rn @pkColumn varchar(50)='',rn @t varchar(50)=''rn)rnasrnwith temp asrn(select row_number()over(order by @pkColumn asc) as rownum,* from @t)rnselect * from temp rn where rownum between @pageIndex * @pageSize and @pageIndex * @pageSize+@pageSize -1rn[/code]rnrn简单的存储过程 总是提示没有申明变量@t
jsp分页代码出错
rnrnrnrn rnxianshirnrnrnrnrnrn = pageCount)rn showPage=pageCount;rn rn int position =(showPage-1)*pageSize+1;rn rs.absolute(position);rn %>rn rn rn 序号rn 名称rn rn rn rn rn rn rn rn rnrn rnrn rn 首页 rn rnrn 1)rn%>rn 上一页rn 末页rn 共页rn 第页 rnrnrn rnrnrn 看看这短代码哪里有<em>问题</em>? 为什么在点 上一页,下一页时,显示的内容没有跟新呢?
asp分页出错
rs.open sql,conn,1,1rn if not rs.eof thenrn counts=rs.recordcountrn dim pagesizern psize=10 '这里定义每页显示数目rn pg=request.QueryString("page")rn rn if pg="" thenrn pg=1rn end ifrn ' pg=cint(pg)rn if (counts mod psize)=0 thenrn response.write "0"rn allpages=cint(counts\psize)rn elsern allpages=cint(counts\psize)+1rn response.write "1"rn end ifrn rn if not isnumeric(pg) thenrn response.Write " "rn end ifrn if pgallpages thenrn pg=1rn end ifrn rn rn rs.pagesize=psizern rs.absolutepage=pg rn rn rn rn rn rn base="http://"& request.servervariables("http_host") & request.servervariables("script_name")rn for i=1 to psizern if rs.eof then exit forrnrnrn上面的代码,可以正常输出记录。但是点下一页的时候还是停留在第一页。不知道为什么。rnrn下一页的链接是 http://127.0.0.1/list.asp?page=2&id=17rnrn本页显示总记录数19个。共两页
asp+sqlserver 分页出错
程序如下:rnif Request.QuertString("page")="" then rnpage=1rnelsernpage=Request.QueryString("page")rnset rs=Server.CreateObject("ADODB.RecordSet")rnrs.Open "select * from TheColumn order by ColumnID desc",cn,3,3rnrs.PageSize=3rnrs.AbsolutePage=pagernfor i=1 to rs.PageSizern if rs.eof then exit forrn Response.Write(rs("ColumnName"))rnnextrn错误信息:rnADODB.Recordset 错误 '800a0cb3' rnrn当前记录集不支持书签。这可能是提供程序或选定的游标类型的限制。rn以前access都是这样写的没有出过错。怎么用sqlserver变成这样了?
DataList分页出错
using System;rnusing System.Collections;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Data.OleDb;rnusing System.Drawing;rnusing System.Web;rnusing System.Web.SessionState;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.HtmlControls;rnrnnamespace LczArt.Chinarnrn /// rn /// List 的摘要说明。rn /// rn public class List : System.Web.UI.Pagern rn rn protected System.Web.UI.WebControls.Label lblCurrentPage;rn protected System.Web.UI.WebControls.HyperLink lnkPrev;rn protected System.Web.UI.WebControls.HyperLink lnkNext;rn protected System.Web.UI.WebControls.DataList DataList1;rn rnrn private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rnrn rn if (!this.IsPostBack)rn rn string strSQL="";rnrn switch(Request["id"].ToString ().Trim ())rn rnrn case "gdrw": rn strSQL="select * from gdrw ";rn break;rnrn case "rt": rn strSQL="select * from rt ";rn break;rn rnrn Data_Bind(strSQL);rnrn rn rn rnrn public void Data_Bind(string strSQL)rn rn OleDbConnection objConn=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + rn Server.MapPath("../Data/LczArt.mdb"));rn OleDbDataAdapter objCommand=new OleDbDataAdapter(strSQL,objConn);rn DataSet ds=new DataSet();rn objCommand.Fill(ds);rn rn PagedDataSource objPds = new PagedDataSource();rn rn objPds.DataSource = ds.Tables[0].DefaultView;rn objPds.AllowPaging = true;rn objPds.PageSize = 25;rn int CurPage;rn if (Request.QueryString["Page"] != null)rn CurPage=Convert.ToInt32(Request.QueryString["Page"]);rn elsern CurPage=1;rnrn objPds.CurrentPageIndex = CurPage-1;rn lblCurrentPage.Text = "当前页:" + CurPage.ToString();rnrn if (!objPds.IsFirstPage)rn lnkPrev.NavigateUrl=Request.CurrentExecutionFilePath + "?Page=" + Convert.ToString(CurPage-1);rnrn if (!objPds.IsLastPage)rn lnkNext.NavigateUrl=Request.CurrentExecutionFilePath+ "?Page=" + Convert.ToString(CurPage+1);rn rn DataList1.DataSource =objPds;rn DataList1.DataBind();rn rn rnrn rn #region Web 窗体设计器生成的代码rn override protected void OnInit(EventArgs e)rn rn //rn // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。rn //rn InitializeComponent();rn base.OnInit(e);rn rn rn /// rn /// 设计器支持所需的方法 - 不要使用代码编辑器修改rn /// 此方法的内容。rn /// rn private void InitializeComponent()rn rn this.Load += new System.EventHandler(this.Page_Load);rnrn rn #endregionrn rnrn
分页出错,求解
不知怎么搞的,一旦给PageAbsolute赋值就发生错误,我将sql语句简化为只有一条select语句,而且用最简单的方式给pageAbsolute赋值,但是错误总指向赋值这一行rn不知是何原因,求教?我用的是oracle数据库。
hibernate 分页出错。。。
代码[code=java]public List allpage(int currentPage, int pageSize) rn // 当前页码从1开始rnrn // 每页显示的数据量rn List pagelist = new ArrayList();rn System.out.println("<em>分页</em>的开始 start -------------");rnrn rn try rn if (currentPage == 0) rn currentPage = 1;rn rn String hql = "from Goods";rn Query query = sessionFactoryrn .getCurrentSession()rn .createQuery(hql);rn query.setFirstResult((currentPage - 1) * pageSize);rn query.setMaxResults(pageSize);rn pagelist = query.list();rn rn catch (Exception e) rn // 如果有异常,撤销事物rn e.printStackTrace();rn finally rn // 关闭sessionrn rn rnrn System.out.println("<em>分页</em> end -------------");rn return pagelist;rnrn [/code]rnrn异常:rn[code=java]java.lang.NullPointerExceptionrn at com.ccit.service.impl.GoodsServiceBean.getTotalPage(GoodsServiceBean.java:150)rn at junitTest.pageTest2.testAllpage(pageTest2.java:25)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)rn at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)rn at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)rn at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:309)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rn[/code]
分页出错
我们做的后台管理页面,每次点击页面我都是将其送入servlet进行处理<em>分页</em>显示出来,出现一个<em>问题</em>,就是后台每个操作都要进入servlet进行处理不然就不能显示,那么你们是怎么处理的呢?还有就是每个操作都要进行一次<em>分页</em>数据的存入然后在页面中取出来,代码的重复太大了,你们是怎么使代码重用度变大的?谢谢!
分页出错:by zero
[color=#FF0000][/color] rnrn rn 首页rn rnrn rn 上一页($pageNumber)rn rnrn rn $pageNumberrn rnrn rn 下一页($pageNumber)rn rnrn rn 尾页rn rnrn rn rn提示红色部分错误
ASP分页出错
[code=Assembly]rn rn[/code]rnrn只能显示第一页啊 其它页的内容跟第一页一样 怎么回事啊 如果换成rs.movenext就可以<em>分页</em> 但我的数据库文章是从下到上的呀 rs.movenext就反了。。。
求助GRIDVIEW分页出错
大家都说2.0的GridView可以自己<em>分页</em>,为什么我点下一页或末页会<em>出错</em>呢?总是不能显示到除第一页外的页面上去。 rn rn我是用几个TEXTBOX组合成查询条件,再来绑定GridView rn查询按钮的代码如下: rnprotected void BTN_QRY_Click(object sender, EventArgs e) rn rn string sqlqry; rn sqlqry = "select id as 序号,xm as 申请人,gs as 公司 ,topic as 主题,shijian as 申请时间,ispass as 状态 from t_bulletin_pt where gs='"+DDL_GS.Text+"' "; rn if((CB_ID.Checked ==false) && (CB_GRID.Checked ==false) && (CB_TIME.Checked == false) && (CB_TOPIC.Checked ==false) && (CB_JE.Checked == false)) rn rn Label1.Text="请至少选择一个查询条件!"; rn rn else rn rn Label1.Text = ""; rn if (CB_ID.Checked == true) rn rn sqlqry = sqlqry + " and id='" + TB_ID.Text + "'"; rn rn if (CB_GRID.Checked == true) rn rn sqlqry = sqlqry + " and xm='" + TB_GRID.Text + "'"; rn rn if (CB_TIME.Checked == true) rn rn sqlqry = sqlqry + " and shijian>='" + TB_TIME1.Text + "' and shijian); rn GridView1.DataSource = ds; rn GridView1.DataBind(); rn rn rn rn rn rn <em>出错</em>:GridView“GridView1”激发了未处理的事件“PageIndexChanging”。rn后来在网上找,增加PageIndexChanging代码如下:rnprotected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)rn rn GridView1.PageIndex = e.NewPageIndex;rn GridView1.DataBind();rnrn rn现在点下一页是不显示<em>出错</em>了,但是却没有数据显示,怎么处理呢?
问题不难。。
屏蔽鼠标右击事件。。。在winform里面如何实现啊?rn做了一个过滤器,,,整的整个页面都不能右击了。。这不是我想要的结果。rn我只想让其中一个控件不能右击。。rn求救。
不难但是很烦的问题
现在我有一台是HP的品牌机是HP410的,我很不小心把援助光盘丢了,现在重新系统后没有显卡的驱动,那位有的告诉我或者是什么样的芯片组给我也行。rn我的地址:henryzkf@163.netrn给分10分。Are you ready?
帮帮忙!不难问题
如何在wingows应用程序里面加入.swf文件。rn用pictureboxzm怎么不可以???
问个不难问题。。
Problem DescriptionrnI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.rnrn rnrnInputrnThe first line of the input contains an integer T(1 + sum);rn System.out.println();rn elsern break;rn rn rn rn rn rn public static int out(BigInteger a)rn String c = a.toString();rn return c.length();rn rnrn[/code]rnrn请问哪里有<em>问题</em>啊
所有者问题 不难
数据库表:dbo.zhaobiao这样的能查询,但是这样的: yycom.zhaopin我就查询不了rn rn说明:这个数据库是导进去的 。我想问怎么该rnrn
有关delete的问题不难
在主线程里我new出了一个变量1(CMsg* pMsg=new CMsg()),赋值后把它传入另一个线程,在第二个线程中,我定义了变量2接收变量1 :rnCMsg* msg;rnmsg=(CMsg*)wparam;rn...rndelete msg;rnrn在第二个线程我delete掉msg,非法!请教!
一个不难问题
我想让WIN98中产生的临时文件自动备份在D:盘中,该如何实现。谢谢!!!
建网问题,请教,不难
internetrn |rn 校园网服务器rn |rn --------------rn | |rn 客户A 客户Brnrn<em>问题</em>:客户A安装iis5并发布了一个web站点,想在internet中浏览,怎么实现??rn
一个应该不难问题
如何把16进制数做加法,并且求和以后得到后2位?rn string[] SendData = new string[10];rn SendData[0] = "68";rn SendData[1] = "01";rn SendData[2] = "91";rn SendData[3] = "01";rn SendData[4] = "02";rn SendData[5] = "00";rn SendData[6] = "01";rn SendData[7] = "68";rn SendData[8] = "81";rn SendData[9] = "00";rn把这个字符串先转换为16进制数字,然后相加以后为和为1E7,我想得到E7(也就是说相加以后取和的最后2位),请问如何用程序实现?
数据库备份恢复的问题不难
数据库备份,恢复的方法把一个数据移植到一个新的数据库服务器,但是库里边表的主键和表与表之间的关系都没了,请问到底应该怎么移植嘛
javamail的问题,会了不难
我前些时作了一个webmail的系统,这几天发现收邮件时出现了一点小<em>问题</em>,检查发现收邮件时某个邮件正文的类型为text/plain; charset="GB2312_CHARSET",<em>问题</em>就出现在charset="GB2312_CHARSET"上,用getContent()方法时会返回 java.io.UnsupportedEncodingException: GB2312_CHARSET 的错误,请问应该怎样解决呢,有没有其他的方法取出正文的内容?
问题不难吧?
我的程序的DSW,DSP文件丢了,肯定是找不回来了,如何通过其他文件重建项目?
ASP的问题,应该不难...
rnrnrnrn 测试页面rn rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn测试的时候,错误如下:rnMicrosoft OLE DB Provider for ODBC Drivers (0x80040E14)rn[Microsoft][ODBC Microsoft Access Driver] LEVEL 子句中包含一个保留字、拼写错误或丢失的参数,或标点符号不正确。rn/db/test.asp, 第 23 行(在上面已作标记)rn我查了一下recordset的open方法的用法,好像是这么用的,但它为什么总是抱错呢?rn小弟初学,大家帮忙了rn
应该是不难问题
qms是另外一个网页提交的rnqms1=Request.form("qms")rnrs1("数量")=Cint(qms1)rn数量是"int"型的,写入时出现以下错误,如果能解决?rnMicrosoft VBScript 运行时错误 (0x800A000D)rn类型不匹配: 'Cint'rn/bj/data.asp, 第 69 行rn
自定义控件的问题,应该不难
我自定义了一个DataGrid控件,其实什么修改也没做,就是新建一个Windows控件库,然后放一个datagrid进去,编译生成dll,添加到工具栏,然后新建一个应用程序,把那个datagrid拖进去,结果不能象普通的datagrid那样用,显示不了数据,换成普通的datagrid就没<em>问题</em>.以下是一般的把数据库里的信息显示出来的代码:rn Tryrn Dim cn As New Odbc.OdbcConnection("Driver=Microsoft Access Driver (*.mdb);DBQ=D:\db1.mdb")rnrn Dim cmd As New Odbc.OdbcCommand("Select * From CONTRACT", cn)rnrn Dim da As New Odbc.OdbcDataAdapter(cmd)rnrn Dim ds As New DataSet("tt")rnrn Dim dt As New DataTablernrn Dim dr As DataRowrnrn cn.Open()rnrn da.Fill(ds, "CONTRACT")rnrn cn.Close()rnrn dt = ds.Tables(0)rnrn If dt.Rows.Count > 0 Thenrnrn dr = dt.Rows(0)rnrn If dr("con_no") Is DBNull.Value Then Exit Subrnrn DataGrid1.DataSource = dtrnrnrnrn Dim ts1 As New DataGridTableStylernrn ts1.MappingName = "CONTRACT"rnrn Dim myDataCol As New DataGridTextBoxColumnrnrn myDataCol.HeaderText = "合同"rnrn myDataCol.MappingName = "con_no"rnrn myDataCol.Alignment = HorizontalAlignment.Centerrnrn ts1.GridColumnStyles.Add(myDataCol)rnrn DataGrid1.TableStyles.Add(ts1)rnrn End Ifrnrn Catch ex As Exceptionrnrn MsgBox(ex.ToString)rnrn End Tryrnrn有经验的能告诉一下为什么吗?
不难问题,有请高手!
如何在集合的条件下,从数据库写出值来,代码例如:rnfor each value in con.execute("select num from ka where num in ("&tex6&") and xuan='1'")rn response.write valuern nextrn为何循环不出来?
select 的问题,应该不难~
rn3rnrnrndocument.form1.select1.value=1rndocument.form1.select1.????=3
有趣的问题,应该不难
在快速启动栏里点了"显示桌面"后.所有打开的窗口都会最小化.rn我想我的程序在点了"显示桌面"后不会最小化,仍然显示在那里,有什么办法吗?rn
求教,问题不难
请问有什么操作能用数组完成,而用指针不行??
拼图游戏MFC编程,里面包含最基础的MFC编程下载
里面包含最基础的MFC编程,能够很好的被大家学习,初学者能更好的了解。 相关下载链接:[url=//download.csdn.net/download/melodylcheng/3354989?utm_source=bbsseo]//download.csdn.net/download/melodylcheng/3354989?utm_source=bbsseo[/url]
电子商务概论实训指导书.doc下载
电子商务概论实训指导书.doc 相关下载链接:[url=//download.csdn.net/download/zjf11jy/4663438?utm_source=bbsseo]//download.csdn.net/download/zjf11jy/4663438?utm_source=bbsseo[/url]
自制MP3播放器下载
自制MP3播放器 相关下载链接:[url=//download.csdn.net/download/qw19696/4674713?utm_source=bbsseo]//download.csdn.net/download/qw19696/4674713?utm_source=bbsseo[/url]
相关热词 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd c# 操作sql视图
我们是很有底线的