[RESOLVED] Saving to DB using bound DataGridView in VB.Net
Just started teaching myself .net this weekend and I'm probably missing something fairly obvious:rolleyes:
I've create a simple test database and a dataset in the project. Created a simple fom and dragged a table onto it to auto-create a datagridview. All looks good and it displays the test data I populated into the DB fine.
But if I make any changes and click Save they're not getting saved. I re-run the program and they've dissapeared. The code behind the save button is here:-
Code:
Private Sub AccountBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AccountBindingNavigatorSaveItem.Click
If Me.Validate() Then
Me.AccountBindingSource.EndEdit()
Me.AccountTableAdapter.Update(Me.BloodNGutzDataSet.Account)
Else
MsgBox("Validation Failed", MsgBoxStyle.OkOnly & MsgBoxStyle.Exclamation)
End If
End Sub
I can break into the code and it does run through this routine, it passes the validation and runs the EndEdit and Update statements. It's just that nothing seems to actually change in the DB. Any ideas what I'm doing wrong?
Re: Saving to DB using bound DataGridView in VB.Net
I'm not an expert with .Net, but I think the problem (and solution) might be as described in this post
Re: Saving to DB using bound DataGridView in VB.Net
Spot on and may I just say:-
THATS A @/**$& STUPID SETTING:mad:
:bigyello: