private void searchbutton_Click(object sender, EventArgs e) { SearchTeacher st = new SearchTeacher(); st.TID = idtextBox.Text; st.Name = nametextBox.Text; st.Desegnation = desegnationtextBox.Text; st.Depertment = depertmenttextBox.Text; st.CouncellingHour = councellinghourtextBox.Text; st.CourseAdvisor = courseadvisorcomboBox.Text; st.ContactNo = contactnotextBox.Text; st.Adress = adresstextBox.Text; st.Salary = 0; float.TryParse(salarytextBox.Text, out st.Salary); Search_teacher_BL steacher = new Search_teacher_BL(); DataTable result = steacher.search_TeacherANDsendToDAL(st); if (result != null) { teachersearchinfodataGridView.DataSource = result; idtextBox.Text = ""; nametextBox.Text = ""; desegnationtextBox.Text = ""; depertmenttextBox.Text = ""; courseadvisorcomboBox.Text = ""; councellinghourtextBox.Text = ""; salarytextBox.Text = ""; adresstextBox.Text = ""; contactnotextBox.Text = ""; } else { MessageBox.Show("AN Error Has Been Occured!!!"); } }
public void PopulateDataGrideview() { Search_teacher_BL SearchTe = new Search_teacher_BL(); DataTable dt = new DataTable(); dt = SearchTe.GetExistingFromBL(); teachersearchinfodataGridView.DataSource = dt; }