Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Updating the database

Status
Not open for further replies.

markvan

Technical User
Sep 12, 2001
37
0
0
AU
I have these 2 buttons, the load button works, it gets all the data into the dataset and I have bound some txtboxes to the dataset so it displays the relevant info.
My problem is when I try to update the changes I make.

Please comment on my code as I have stuffed around with this for hours and can't save the updates back into the database. The bolded line is the problem.

Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
' this loads all the data from the databse into the dataset
daAuthor.Fill(PolicyCreatorDataset1)
' Confirmation message
MsgBox("You have loaded this info")
End Sub

Private Sub btnSaveChanges_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveChanges.Click
' This is supposed to save the changes made in the dataset into the database
daAuthor.Update(PolicyCreatorDataset1, "tblAuthor")
' Confirmation message
MsgBox("You pressed the right button to save your editing")
End Sub

Mark Van
EZ-PC Help
 
I suppose you used the wizard to make the dataset and dataadapter and the connection and all the other thins (Not a good choise).

before the update line add this

me.bindingcontext(PolicyCreatorDataset1).endcurrentedit

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top