My database program is fully functional and when I add new entries to the database they appear on my DataGridView correctly. However after I close the program these changes are not saved. How do I save the changes back to the database? Here's my code:
Dim conn As New SqlClient.SqlConnection(My.Settings.MainDatabaseConnectionString)
Dim query As String = "INSERT INTO Users VALUES('Something','Test');"
Dim cmd As New SqlClient.SqlCommand(query, conn)
Dim reader As SqlClient.SqlDataReader
'Open Connection
conn.Open()
'Execute Query
reader = cmd.ExecuteReader
'Close Connection
conn.Close()
'Update DataGridView
Me.UsersTableAdapter.Fill(Me.UsersDataSet.Users)