private void BindData() { try { Class1 c = new Class1(); DataSet ds = new DataSet(); string s = "Select * from Notice"; ds = c.select(s); if (ds.Tables[0].Rows[0][0] != null) { Notice.DataSource = ds; Notice.DataBind(); } } catch (Exception ex) { Response.Write("<script>alert('Error:" + ex.Message + "');</script>"); } }
protected void OnPaging(object sender, GridViewPageEventArgs e) { BindData(); Notice.PageIndex = e.NewPageIndex; Notice.DataBind(); }