Skip to content

Commit 8c65efd

Browse files
committed
Add save on close code
1 parent ac06dad commit 8c65efd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

EF Sqlite/Form1.vb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Public Class Form1
21
Imports System.ComponentModel
32
Imports System.Data.Entity
43
Public Class Form1
@@ -13,4 +12,10 @@ Public Class Form1
1312

1413

1514
End Sub
15+
16+
Private Sub Form1_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
17+
DataGridView1.EndEdit()
18+
ContactBindingSource.EndEdit()
19+
db.SaveChanges()
20+
End Sub
1621
End Class

0 commit comments

Comments
 (0)