5月,我们的纪念
在1.0版的基础上作了以下改进:
  • 支持将数据源输出。表明你可以将数据控件的DataSource指定为该分页控件。
  • 无需指定记录数。记录数在控件中已进行计算。
  • 需指定SQL语句。
  • 虽然有ExecuteType的枚举,但并未实现,目前只支持ExecuteType.Text的枚举。
  • 示例代码:
    //取页码
    if (Request.QueryString["page"] != null)
    {
    _pageindex = Int16.Parse(Request.QueryString["page"]);
    }

    this.Pager1.CurrentPage = _pageindex;
    this.Pager1.Sql = "select subject from documents order by publishdate desc";
    this.GridView1.DataSource = this.Pager1.GetDataSource(connectionstring);
    this.GridView1.DataBind();
     
    GetDataSource方法有一个重载:
    public DataView GetDataSource(string connectionstring)
    public DataView GetDataSource(SqlConnection conn)
     
    Categories:   Blog相关
    Tags:   , ,
    Actions:   Comments (6) |

    Comments

    1#

    October 18 2006 , 11:34

    幻想曲

    该控件是在vs2005/.net 2.0下编写
    在1.1下可能无法加载到工具箱

    幻想曲 | Top

    2#

    December 2 2006 , 10:34

    巫枫

    应该写一个显示的页面,这样初学着也可以用,

    巫枫 | Top

    3#

    December 2 2006 , 10:45

    幻想曲

    Re:巫枫
    我Blog里凡是涉及到分页的地方都是用的控件

    幻想曲 | Top

    4#

    January 25 2007 , 12:14

    不惊鸟

    我在ACCESS下用它报:不支持关键字: “provider”。
    是否只能用于SQL Server[em12]

    不惊鸟 | Top

    5#

    January 25 2007 , 12:24

    幻想曲

    好像是只支持sql server[em10]

    幻想曲 | Top

    6#

    February 11 2007 , 18:32

    jeky

    单纯的一个DLL文件,没有太大的意义。

    jeky | Top

    Add comment



    (Will show your Gravatar icon)  



      Country flag


    [b][/b] - [i][/i] - [u][/u]- [quote][/quote]

    :-/ ^_^ :d :o :kiss: :) :p :se: [yeah] :( :love: :han: :up: :cry: :zzz: o_o


    申请链接请看这里