private void studentInsertButton_Click(object sender, EventArgs e) { if (nameTextBox.Text.Length != 0) { Student studentObj = new Student(); studentObj.Name = nameTextBox.Text; StudentData studentData = new StudentData(); studentData.Insert(studentObj); populate(); } }
private void populate() { StudentData studentData = new StudentData(); studentDataGrid.DataSource = studentData.GetList(); }