protected void dd_sem_SelectedIndexChanged(object sender, EventArgs e) { string st = "Select distinct Reg_number from student where dept='" + dd_dept.Text + "' and sem=" + dd_sem.Text + ""; // cmd = new SqlCommand("select * from subjects where dept= '" + dd_dept.Text + "' and sem=" + dd_sem.Text + " ", db.db); //int x = cmd.ExecuteNonQuery(); //SqlDataReader re = cmd.ExecuteReader(); SqlDataReader dr = db.sqldr(st); DropDownList1.Items.Clear(); while (dr.Read()) { DropDownList1.Items.Add(dr["Reg_number"].ToString()); } }
protected void dd_sem_SelectedIndexChanged(object sender, EventArgs e) { string st = "select * from subjects where dept= '" + dd_dept.Text + "' and sem=" + dd_sem.Text + " "; // cmd = new SqlCommand("select * from subjects where dept= '" + dd_dept.Text + "' and sem=" + dd_sem.Text + " ", db.db); //int x = cmd.ExecuteNonQuery(); //SqlDataReader re = cmd.ExecuteReader(); SqlDataReader dr = db.sqldr(st); dd_sub.Items.Clear(); while (dr.Read()) { dd_sub.Items.Add(dr["title"].ToString()); sub_id = Convert.ToInt32(dr["Id"].ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["student"] == null) { Response.Redirect("../Default.aspx"); } else { string st = "select Reg_number,sub as Subjects,Total_Maximum,Assignment_Maximum,assign as Assignment,Minor1,Minor2,Total from MarksCard where Reg_number=" + Session["student"] + ""; db.fill_grid_ret_sqlda(st, GridView1); string str = "select sum(Total) from MarksCard where Reg_number=" + Session["student"] + ""; SqlDataReader dr = db.sqldr(str); while (dr.Read()) { Label1.Text = dr.GetValue(0).ToString(); } dr.Close(); } }