using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml; using System.Data.SqlClient; using System.Data.SqlTypes; public partial class Administrator_TestimonialView : System.Web.UI.Page { SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString); DataSet ds = new DataSet(); SqlCommand cmd; Dashboard objDash = new Dashboard(); FillDD objFillDD = new FillDD(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Fill_GridTestimonial(); } } private void Fill_GridTestimonial() { try { SqlDataAdapter adp = new SqlDataAdapter("SELECT * from tbl_Testimonial Order By Id Desc", con); adp.Fill(ds, "Test"); adp.Dispose(); GVTestimonial.DataSource = ds.Tables["Test"]; GVTestimonial.DataBind(); if (GVTestimonial.Rows.Count < 1) { lblDgErr.Text = "Alert! : Zero Records in Database"; } else { objDash.Count_Total(ref lblDGCount, "Id", "tbl_Testimonial", "", ref lblDgErr); } } catch (Exception ex) { lblDgErr.Text = ("GV Alert! : " + ex.Message); } } protected void GVTestimonial_PageIndexChanging(object sender, GridViewPageEventArgs e) { lblDgErr.Text = ""; try { GVTestimonial.PageIndex = e.NewPageIndex; Fill_GridTestimonial(); } catch (Exception exp) { lblDgErr.Text = ("GV Paging Alert! : " + exp.Message); } } }