protected void Page_Load(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = cls.select("select * from hall_details"); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = cls.select("select * from Register where Reg_type='" + DropDownList1.SelectedItem.ToString() + "'"); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = cls.select("select Reg_FullName from Register where Reg_type='Owner'"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownList1.Items.Add(ds.Tables[0].Rows[i].ItemArray[0].ToString()); } }
protected void Page_Load(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = cls.select("select * from Register where Reg_type='Owner'"); //for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //{ // DropDownList1.Items.Add(ds.Tables[0].Rows[i].ItemArray[0].ToString()); //} GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { if (DropDownList1.SelectedItem.ToString() == "Customer") { DataSet ds = new DataSet(); ds = cls.select("select * from Register where Reg_FullName='" + TextBox1.Text + "' and Reg_pwd='" + TextBox2.Text + "'"); if (ds.Tables[0].Rows.Count == 1) { Response.Redirect("Userhome.aspx"); } else { Response.Redirect("invalid user....."); } } else if (DropDownList1.SelectedItem.ToString() == "Owner") { DataSet ds = new DataSet(); ds = cls.select("select * from Register where Reg_FullName='" + TextBox1.Text + "' and Reg_pwd='" + TextBox2.Text + "'"); if (ds.Tables[0].Rows.Count == 1) { Response.Redirect("OwnerHome.aspx"); } else { Response.Redirect("invalid user....."); } } else if (DropDownList1.SelectedItem.ToString() == "Admin") { if (TextBox1.Text == "Admin" && TextBox2.Text == "Admin") { Response.Redirect("AdminHme.aspx"); } else { Response.Redirect("invalid user....."); } } }