Reputation: 604
I have set Oracle connection to DatagridView, via manager. Line for this is:
Me.UsersTableAdapter.Fill(Me.MyDataSet._Users)
Now I want to save all changes made in Datagridview to DB. Tried this but not working:
Me.UsersTableAdapter.Update(Me.MyDataSet._Users)
What am I missing here ?
Upvotes: 0
Views: 1294
Reputation: 972
1.Maybe you are missing validate()
and endEdit()
?
Try
Me.Validate()
Me.UsersBindingSource.EndEdit()
Me.UsersTableAdapter.Update(Me.MyDataSet._Users)
MsgBox("Update successful")
Catch ex As Exception
MsgBox("Update failed")
End Try
Update
Fix the code I present -
Me.UsersBindingSource.EndEdit()
Upvotes: 1
Reputation: 604
Solved. Correct synthax is:
Try
Me.Validate()
Me.UsersBindingSource.EndEdit()
Me.UsersTableAdapter.Update(Me.MyDataSet._Users)
MsgBox("Update successful")
Catch ex As Exception
MsgBox("Update failed")
End Try
@the scion, thanks !!
Upvotes: 0