private void StudentListForm_Activated(object sender, EventArgs e) { // TODO: This line of code loads data into the 'cOMP123DataSet.Students' table. You can move, or remove it, as needed this.studentsTableAdapter.Fill(this.cOMP123DataSet.Students); // it has already included "this.studentsTableAdapter.Fill(this.cOMP123DataSet.Students)" StudentDataContext db = new StudentDataContext(); List<Student> studentList = (from student in db.Students select student).ToList(); StudentDataGridView.DataSource = studentList; }
private void StudentListForm_Activated(object sender, EventArgs e) { // TODO: This line of code loads data into the 'cOMP123DataSet.Students' table. You can move, or remove it, as needed this.studentsTableAdapter.Fill(this.cOMP123DataSet.Students); // it has already included "this.studentsTableAdapter.Fill(this.cOMP123DataSet.Students)" StudentDataContext db = new StudentDataContext(); List <Student> studentList = (from student in db.Students select student).ToList(); StudentDataGridView.DataSource = studentList; }