Beispiel #1
0
        public void commentView()
        {
            SqlConnection con = new SqlConnection(connStr);

            con.Open();
            string     sQry = "select FName,PName,PCmt,grade from dbo.Comment";
            SqlCommand cmd  = new SqlCommand(sQry, con);

            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable      dt = new DataTable();
            DataSet        ds = new DataSet();

            da.Fill(dt);
            con.Close();
            ds.Tables.Add(dt);

            DisplayComment.DataSource = ds.Tables[0];
            DisplayComment.DataBind();
        }
Beispiel #2
0
        protected void OnPagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
        {
            (DisplayComment.FindControl("DataPager1") as DataPager).SetPageProperties(e.StartRowIndex, e.MaximumRows, false);

            if (hdnText.Value != "")
            {
                string yourValue = hdnText.Value.ToString();
                if (yourValue == "Default")
                {
                    commentView();
                }
                else
                {
                    this.commentView();
                }
            }
            //else
            //{
            this.commentView();
            //}
        }