private void batch_comboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         StudentResult sr=new StudentResult();
         batchWise_dataGridView.DataSource = sr.getBatchwiseResult(session_comboBox.Text,batch_comboBox.Text,date);
     }
     catch (Exception ex) {
         MessageBox.Show(ex.ToString());
     }
 }
 private void save_button_Click(object sender, EventArgs e)
 {
     try
     {
         StudentResult sr = new StudentResult();
         DataTable dt = new DataTable();
         dt.Columns.Add("ID");
         dt.Columns.Add("Subject");
         dt.Columns.Add("Date");
         dt.Columns.Add("Written");
         dt.Columns.Add("MCQ");
         dt.Columns.Add("Total");
         dt.Columns.Add("Remarks");
         DataRow dr;
         int length = InsertMark_dataGridView.Rows.Count;
         for (int i = 0; i < length; i++) {
             dr = dt.NewRow();
             dr["ID"] = InsertMark_dataGridView.Rows[i].Cells[0].Value.ToString();
             dr["Subject"] = subject_comboBox.Text;
             dr["Date"] = date;
              string wrtn=InsertMark_dataGridView.Rows[i].Cells[1].Value.ToString();
              string mcq=InsertMark_dataGridView.Rows[i].Cells[2].Value.ToString();
              double totalMark = Convert.ToDouble(wrtn) + Convert.ToDouble(mcq);
             dr["Written"] = wrtn;
             dr["MCQ"] = mcq;
             dr["Total"] = totalMark.ToString();
             dr["Remarks"] = InsertMark_dataGridView.Rows[i].Cells[3].Value.ToString();
             dt.Rows.Add(dr);
         }
         sr.AddResult(dt);
         MessageBox.Show("Marks Saved Successfully");
     }
     catch (Exception ex) {
         MessageBox.Show(ex.ToString());
     }
 }
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     StudentResult sr = new StudentResult();
     studentwise_dataGridView.DataSource = sr.getResultOfSelectedStudent(Id_comboBox.Text);
 }