In this article i will tell you How to update record into access database using VB .Net.
In the Previous articles i explained How to create connection string, how to insert record into access database using c#.net, how to update record into access database using c#.net, how to delete record from access database using c#.net, which namespace is used for membership class, how to insert record into access database using vb.net and many more about VB.Net.
Use below namespace.
Write below code on click event of the button.
Dim con As New OleDbConnection("YourConnectionString")
Dim cmd As New OleDbCommand("update table1 set name='Gorav Verma',age='23',class='12th' where id='10001'", con)
lbl_msg.Text = "Record Updated Successfully."
lbl_msg.Text = "Error Occured."
Below is the explanation.
Create connection with your database. Replace "YourConnectionString" with your own connection string.
Open Your Connection.
Create Sql command for updating records into table1. Here i am updating the records into columns "name","age","class"of table "table1" where id='10001'. Also pass your connection in oledbcommand.
Show Message if record updated successfully.
Close the connection.