asp教程.net 的aspnetpager分页代码
@ page language="c#" autoeventwireup="true" codefile="default.aspx.cs" inherits="test_default" stylesheettheme="default" %>
using system;
using system.data;
using system.configuration;
using system.collections;
using system.web;
using system.web.security;
using system.web.ui;
using system.web.ui.webcontrols;
using system.web.ui.webcontrols.webparts;
using system.web.ui.htmlcontrols;
using cpp114.tools.oledb;
using system.data.oledb;
using wuqi.webdiyer;public partial class test_default : system.web.ui.page
...{
protected oledbconnection conn = new oledbconnection();
protected oledbcommand cmd = new oledbcommand();protected void page_load(object sender, eventargs e)
...{
if (!ispostback) ...{
initdb();
conn.open();
cmd.commandtext = "select count(*) from t_product";
pager1.recordcount = (int)cmd.executescalar();
conn.close();
binddata();
}}
//初始化连接对象
protected void initdb()...{
conn.connectionstring = oledbtool.myconnstr + server.mappath(oledbtool.mydbname);
cmd.connection = conn;
}
//数据绑定
protected void binddata() ...{
initdb();
oledbdataadapter sda = new oledbdataadapter("select * from t_product",conn);
dataset ds = new dataset();
//sda.fill(ds, 10, 10, "temptbl");
sda.fill(ds, pager1.pagesize * (pager1.currentpageindex - 1), pager1.pagesize, "temptbl");
datalist1.datasource = ds.tables["temptbl"];
datalist1.databind();
}
//翻页事件
protected void changepage(object src, pagechangedeventargs e)
...{
pager1.currentpageindex = e.newpageindex;
binddata();
}}
洋果子店rose最新版本
洋果子店最新版是一款十分容易让人垂涎的开店经营类手游。游戏玩
明日大亨最新版
明日大亨手游,一个非常经典有趣的模拟经营类型的商战手游,在游
早安我的少年日服最新版2024
早安我的少年日服是一款治愈恋爱手游,清新明亮的游戏画面,让你
我的世界基岩版1.16正式版
我的世界基岩版是一款模拟经营手游,游戏采用的是经典像素玩法,
早安我的少年最新版2024
早安我的少年是一款养成恋爱手游,在这款游戏中,玩家们将可以体