protected void BtnAdd_Click(object sender, EventArgs e) { dtcheck = obj.CheckStudentMarks(Convert.ToInt32(ddnstudent.SelectedValue), Convert.ToInt32(ddnclass.SelectedValue), Convert.ToInt32(ddnsection.SelectedValue), ddnsemester.SelectedItem.Text); if (dtcheck.Rows.Count > 0) { lblmsg.Text = "Marks Already Exist"; } if (dtcheck.Rows.Count <= 0) { i = obj.AddtStudentMarks(Convert.ToInt32(ddnstudent.SelectedValue), Convert.ToInt32(ddnclass.SelectedValue), Convert.ToInt32(ddnsection.SelectedValue), ddnsemester.SelectedItem.Text, Convert.ToInt32(txtreading.Text), Convert.ToInt32(txtwriting.Text), Convert.ToInt32(txtenglish.Text), Convert.ToInt32(txthindi.Text), Convert.ToInt32(txtmaths.Text), Convert.ToInt32(txtscience.Text) , Convert.ToInt32(txtcomputers.Text), Convert.ToInt32(txtss.Text), Convert.ToInt32(ddnhealth.SelectedValue), txtedu.Text, txtcomment.Text, "Teacher", Convert.ToInt32(Session["tuid"]), DateTime.Now.ToString()); if (i > 0) { Session["StudentId"] = ddnstudent.SelectedValue; lblmsg.Text = "Data Has Been Added"; ClearFields(); BindData(); Response.Redirect("ReportCard.aspx"); } } }