前台GridView页脚代码:
后台绑定事件:
bind_gv()是
DataTable dt = new DataTable();
//dt = ClsDataBase.ExecuteNonQuery("select * from test");//这里放你的查询方法
this.GridView1.DataSource = dt;
this.GridView1.DataBind();
(出处:http://blog.csdn.net/zhaoqiliang527/archive/2009/02/15/3893312.aspx)