Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
MySqlConnection conn = new MySqlConnection(connect.connStr); conn.Open(); string sql = "select * from xxx where yyy='" + zz+ "'"; MySqlCommand cmd = new MySqlCommand(sql, conn); MySqlDataAdapter Adapter = new MySqlDataAdapter(cmd); DataTable daset = new DataTable(); Adapter.Fill(daset); GridView1.DataSource = daset; GridView1.DataBind(); Cache["xxx"]= daset; conn.Close(); protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; gridbinding(); } private void gridbinding() { GridView1.DataSource = (DataTable) Cache["xxx"]; GridView1.DataBind(); }
PageIndexChanged
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)