I am currently having a few issues saving new information to a dataset. I could update the set, but on exiting and reopening the data all updates were gone. I found a few tips online but now get error messages when running the update command. Any help would be greatly appreciated.
This is how the code looks at present.
Private Sub Confirm_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Confirm.Click
Dim TeamInfo As DataRow = DataDataSet.Tables("Teams").NewRow()
Dim DataDataSet2 As OleDb.OleDbDataAdapter
Dim Connection As New OleDb.OleDbConnection
Dim SQLCommand As String
SQLCommand = "SELECT * FROM Teams"
Connection.ConnectionString = "Provider=SQLOLEDB;Data Source = E:\Database Manager\Database Manager\Data.sdf"
DataDataSet2 = New OleDb.OleDbDataAdapter(SQLCommand, Connection)
Dim cb As New OleDb.OleDbCommandBuilder(DataDataSet2)
TeamInfo.Item("Team Name") = Me.Team_NameTextBox.Text
TeamInfo.Item("Abbreviation") = Me.AbbreviationTextBox.Text
TeamInfo.Item("Nationality") = Me.NationalityComboBox.SelectedItem(0)
TeamInfo.Item("Tour") = Me.TourComboBox.SelectedItem(0)
TeamInfo.Item("Finance") = Me.FinanceTextBox.Text
TeamInfo.Item("ID") = Me.IDTextBox.Text
DataDataSet.Tables("Teams").Rows.Add(TeamInfo)
DataDataSet2.Update(DataDataSet, "Teams")
Me.Close()
End Sub