以下是一个web自定义的示例,几年前写的,写得也不是很好,权当抛砖引玉。
主要实现datagrid的分页功能:
调用使用方法:
this.DataGrid1.ConnectionString = DataClass.ConnectionString; //这里指定一个连接字串。 this.DataGrid1.strSQL = strSQL; this.DataGrid1.DataBind();
如果当前的sql中有identitykey,则必须指定
this.DataGrid1.IdentityKey = "字段";
然后绑定。
如果是acesss数据库
this.DataGrid1.bIsAccess = true;
还有几个其他的可选参数,看看代码就明白了。