public void loadRoll() { String batch = AddStudent_BatchName_ComboBox.Text; String term = AddStudent_Term_ComboBox.Text; if (batch.Equals("") || term.Equals("") || batch.Equals(null) || term.Equals(null)) { studentTableDataGridView.DataSource = null; } else { bool flag = controller.BTExists(batch, term); if (flag == true) { studentTableDataGridView.DataSource = null; StudentController sc = new StudentController(); DataTable table = sc.getStudentData(batch); studentTableDataGridView.DataSource = table; dt1 = table; } else { studentTableDataGridView.DataSource = null; } } }