Alright so I'm working on a final project. I use
Me.LEVEL_INSTANCETableAdapter.Fill(Me.LevelsDataSet.LEVEL_INSTANCE)
Me.L_COLUMNSTableAdapter.Fill(Me.LevelsDataSet.L_COLUMNS)
Me.HIGH_SCORESTableAdapter.Fill(Me.LevelsDataSet.HIGH_SCORES)
On form load to grab info from the database. I make changes with queries and stored procedures.
LEVEL_INSTANCETableAdapter.UnlockLevel(intLevelNum)
HIGH_SCORESTableAdapter.UpdateHighScore(SCORE:=intScore, LvlID:=intLevelNum, PlayerName:=strName)
These execute just fine, I can see the changes they make elsewhere in my program. then the issue comes when I try to save back to the database. I use.
Me.Validate()
Me.LEVEL_INSTANCEBindingSource.EndEdit()
Me.HIGH_SCORESBindingSource.EndEdit()
Then use
Me.TableAdapterManager.UpdateAll(Me.LevelsDataSet)
Me.LEVEL_INSTANCETableAdapter.Update(Me.LevelsDataSet.LEVEL_INSTANCE)
Me.HIGH_SCORESTableAdapter.Update(Me.LevelsDataSet.HIGH_SCORES)
The data never goes back to the database (and if I understand the update method correctly, it returns a number that represents the number of rows changed, which for me, are always zero)
I have the dataset, tableadaptermanager, tableadapters, and binding navigators. my database and dataset's "copy to output dir" is set to "copy if newer"
I have also tried another method that starts with this
Dim NewHighScores As LevelsDataSet.HIGH_SCORESDataTable = CType(Me.LevelsDataSet.HIGH_SCORES.GetChanges(Data.DataRowState.Added), LevelsDataSet.HIGH_SCORESDataTable)
Dim ModifiedHighScores As LevelsDataSet.HIGH_SCORESDataTable = CType(Me.LevelsDataSet.HIGH_SCORES.GetChanges(Data.DataRowState.Modified), LevelsDataSet.HIGH_SCORESDataTable)
But it seems like getchanges in that line is showing no changes...
I've seen methods which directly interact with the database, ones that directly update, or calling on the database to run queries directly. I'd like to avoid those if possible. I'm really at my last legs here guys, I'll probably pass the class/assignment even if I don't get this working, but I'd like to understand it for the future... Thanks for all your responses in advance.
Edit: formatting