Private context As TestModelEntities Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load context = New TestModelEntities Dim query = context.employees EmployeeBindingSource.DataSource = query.ToList End Sub Private Sub DepartmentBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EmployeeBindingNavigatorSaveItem.Click Try context.SaveChanges() MessageBox.Show("Changes saved to the database.") Me.Refresh() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub
EmployeeBindingSource.EndEdit()
context.SaveChanges()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)