lim1 - 2008-1-17 10:54:00
准备截图给大家看的但,我不能上传图片!通过qq截图后,用Fireworks转jpg图片,不让上传!提示无效的图片文件!是不是论坛判断的头文件跟我用Fireworks转出来的不一样啊?
我这边分页不能用!看了下存储过程
'SELECT TOP ' + STR(@pagesize) +' [tid],[iconid],[typeid],[title],[price],[hide],[readperm],
[poll],[poster],[posterid],[replies],[views],[postdatetime],[lastpost],[lastposter],
[lastpostid],[lastposterid],[replies],[highlight],[digest],[displayorder],[attachment],[closed],[magic] FROM
[dnt_topics] WHERE [lastpostid] < (SELECT min([lastpostid]) FROM (SELECT TOP ' + STR
((@pageindex-1)*@pagesize-@startnum) + ' [lastpostid] FROM [dnt_topics] WHERE [fid]=' +STR
(@fid) + ' AND [displayorder]=0' + @condition + ' ORDER BY [lastpostid] DESC) AS tblTmp )
AND [fid]=' +STR(@fid) + ' AND [displayorder]=0' + @condition + ' ORDER BY [lastpostid] DESC'
@fid =28
@pagesize=20,
@pageindex=2,
@startnum=0,
@condition varchar(80)=‘’
分页的存储过程是dnt_gettopiclist中间的lastpostid是最后回复帖子id,那怎么分页啊?有点不懂,帮忙解释下
我数据库中的帖子表lastpostid全部为0,执行存储过程,@pageindex=2的时候就没数据了
lim1 - 2008-1-17 16:27:00
原来是动网,后来程序被改了好几次,就感觉数据库全都是乱的
pol2008 - 2008-1-23 11:17:00
MinSplitPage一个非常简单实用的分页程序(小规模数据中使用---建议10万内) --- C# --- .net
特点:使用简单、速度还过的去。
测试结果:
SQL Server 数据库 1百万条数据 每页十条 (没有where与order by)
第1页:用时 1.688 秒
第1000页:用时 1.626 秒
第10000页:用时 1.672 秒
第100000页:用时 1.782 秒
SQL Server 数据库 1百万条数据 每页十条 (order by id DESC)
第1页:用时 1.688 秒
第1000页:用时 1.705 秒
第10000页:用时 1.719 秒
第100000页:用时 1.813 秒
Access 数据库 1百万条数据 每页十条 (没有where与order by)
第1页:用时 0.094 秒
第1000页:用时 0.11 秒
第10000页:用时 0.297 秒
第100000页:用时 2.189 秒
Access 数据库 1百万条数据 每页十条 (order by id DESC)
第1页:用时 6.594 秒
第1000页:用时 6.626 秒
第10000页:用时 6.658 秒
第100000页:用时 8.83 秒
调用形式:
string sql1 = "SELECT * FROM test1";
splitPage = new MinSplitPage.SplitPage(conn, this, 10, sql1, "", "demo2.aspx?");
//string pageIndex = Request.QueryString["askPage"];
//splitPage = new MinSplitPage.SplitPage(conn, Convert.ToInt32(pageIndex), 10, sql1, "", "demo2.aspx?");DataList1.DataSource = splitPage.GetDateTable;
DataList1.DataBind();
Label1.Text = splitPage.CreateNavigation(2) + "当前的记录数:" + splitPage.CurrPageRecordNum.ToString();
附件: minsplitpagedemo.rar (2008-1-23 11:17:26, 31.50 K)
该附件被下载次数 84