private void btnUpdate_Click(object sender, EventArgs e) { int RowIndex = dataGridView1.CurrentCell.RowIndex; int EmployeeID = Convert.ToInt32(dataGridView1.Rows[RowIndex].Cells[0].Value); northwindEntities dc = new northwindEntities(); Employees emp = dc.Employees.Find(EmployeeID); emp.FirstName = EditFirstName.Text; emp.LastName = EditLastName.Text; emp.Title = EditTitle.Text; dc.Entry(emp).State = EntityState.Modified; dc.SaveChanges(); GetEmployees(); }