private void createButton_Click(object sender, EventArgs e) { List <Student> students = DataGridViewUtils.GridToStudents(dataStudent); ClassFile a = new ClassFile("stud.dat"); a.SaveStudent(students, "students.dat"); }