How to Update Data Using VB.Net and MySQL Database

0
330

This tutorial about “How to Update Data Using VB.Net and MySQL Database”, Modifying of data is very important in all Program running with Database. This feature will allow the user to update the selected information displayed in the application.

This tutorial will teach you on how to update selected information from DataGridView. Please follow all the steps to complete this tutorial.

Update Data Using VB.Net and MySQL Database Steps

  1. Add a new button from your toolbox and use it for “update data“.

2. Double click your new added button and insert the following codes below.

  1. Try
  2. Str = "UPDATE user SET firstname='" & txtfname.Text.ToUpper & "',lastname='" & txtlname.Text.ToUpper & "'," & _
  3. "WHERE iduser='" & lblid.Text & "'"
  4. conn.Open()
  5. Dim mysc2 As New MySqlCommand(Str, conn)
  6. mysc2.ExecuteNonQuery()
  7. MsgBox("User successfully updated!", MsgBoxStyle.Information)
  8. conn.Close()
  9. Me.Close()
  10. Catch ex As Exception
  11. MsgBox(ex.Message)
  12. conn.Close()
  13. End Try

If you have any comments or suggestions in How to Update Data Using VB.Net and MySQL Database,Please feel free to leave your comment below, use the contact page of this website or use my contact information.

Email: [email protected]  |  Cell. No.: 09468362375

Previous Topic: How to Save Data Using VB.Net and MySQL Database

Advanced Topic:

 

Facebook Comments
(Visited 342 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here