Updating and Deleting records with Access db

depistol

New member
Joined
Sep 1, 2005
Messages
2
Programming Experience
Beginner
Hello,
I am new too this forum and have a little problem with my VB.NET - Access program. I search the database and get the record displayed. How can I update or Delete te record from the current dataset/database that is loaded in the application?


Thanks,
Dep
 
This is how you delete and update the database

VB.NET:
[size=2]
yourDataset.Yourtable.FindByOrderID(orderID).Delete() ' This statment deletes the record in the dataset.
 
'Or this one deletes the first record in the dataset
 
yourDataset.Yourtable.rows(0)("yourColumn").Delete()
 
'And
yourDataAdapter.Update(yourDataset, "Yourtable") ' This statment updates the record in the actual database

[/size]
 
Last edited:
Ah great...thanks..Is there an equally easy way to update a record? By update I mean pull the record out and change some values and then add it to the database again. Or could I save the changes in temp variables, then delete the records and readd it with the new changes?

thanks,
Dep
 
Back
Top