protected void Page_Load(object sender, EventArgs e) { Label1.Text = "Mr:" + " " + Login_page.getParentNameFromDatabase(); Label_QChild.Text = "Quantity Of Children : " + " " + GetChildQuantity().ToString(); Label2.Text = "Total Amount :" + " " + GetTotalAmount().ToString() + " " + "£"; date = DateTime.Now.ToString("dd.MM.yyy"); LabelDate.Text = date; TextBox3.Text = CurrencyConvertor().ToString(); }
protected void Page_Load(object sender, EventArgs e) { Label19.Text = "Welcome " + " " + Login_page.getParentNameFromDatabase(); if (GetDataFromGridView().Rows.Count == 0) { Label20.Text = "No Child Record Found!!"; } else { GetDataFromGridView(); } }
public GridView GetDataFromGridView() { SqlConnection conn = new SqlConnection(@"Data Source = (LocalDB)\MSSQLLocalDB; AttachDbFilename = C:\Users\tumi\source\repos\LearnOnlineSystem\LearnOnlineSystem\App_Data\Learn_Online_System.mdf; Integrated Security = True"); conn.Open(); SqlCommand cmd = new SqlCommand("select * from points where parent_id ='" + Login_page.boxid + "' AND Parent_Name = '" + Login_page.getParentNameFromDatabase() + "'", conn); GridView1.DataSource = cmd.ExecuteReader(); GridView1.DataBind(); return(GridView1); }