问一个关于GridView的问题,希望大家能帮帮忙啊,谢谢
手动配置数据源时GridView不能自动分页,怎么办啊?
后台是这样写的:
if (!IsPostBack)
{
string a = Session[ "textbox "].ToString();
Label1.Text = a;
OleDbConnection conn = new OleDbConnection(@ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + Server.MapPath( "db1.mdb "));
string sql = "select * from goods where goodsvariety like '% " + a + "% ' or goodsname like '% " + a + "% ' or goodsoprice like '% " + a + "% ' or goodsnprice like '% " + a + "% ' ";
string sql1 = "select * from goods where goodsvariety like '% " + a + "% ' or goodsname like '% " + a + "% ' ";
OleDbDataAdapter da = new OleDbDataAdapter(sql, conn);
OleDbDataAdapter da1 = new OleDbDataAdapter(sql1, conn);
DataSet ds = new DataSet();
DataSet ds1 = new DataSet();
System.Text.RegularExpressions.Regex re = new System.Text.RegularExpressions.Regex(@ "[0-9] ", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
if (re.Matches(a).Count == a.Length)
{
conn.Open();
da.Fill(ds, "textbox ");
GridView1.DataSourceID = null;
GridView1.DataSource = ds.Tables[ "textbox "].DefaultView;
&nb