void FillGrid_Subscription() { if ((string)Session["AdminSessionID"] != null) { string xCode = Session["AdminSessionID"].ToString(); SqlDataAdapter GDA = new SqlDataAdapter(" " + " select Code, Email, SubscribeDate=Convert(varchar(11),SubscribeDate,113) " + " from fp_Subscription order by SubscribeDate desc " + " ", Con); DataSet GDS = new DataSet(); Con.Open(); GDA.Fill(GDS); Con.Close(); GridViewSubscription.DataSource = GDS; GridViewSubscription.DataBind(); } else { Response.Redirect("SessionExpired.aspx"); } }
protected void OnPaging(object sender, GridViewPageEventArgs e) { GridViewSubscription.PageIndex = e.NewPageIndex; GridViewSubscription.DataBind(); FillGrid_Subscription(); }