Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form2
- Public email As String
- Public id_user As String = ""
- Dim MySqlConn As MySqlConnection = New MySqlConnection("server=localhost;user id=root;password=programming;database=tugas")
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim Query As String
- MySqlConn.Open()
- Query = "DELETE FROM user WHERE id_user ='" & id_user & "'", MySqlConn)
- Dim cmd As MySqlCommand = New MySqlCommand(Query, MySqlConn)
- MsgBox(Query)
- Dim i As Integer = cmd.ExecuteNonQuery()
- If (i > 0) Then
- MsgBox("Record is Successfully Deleted")
- Else
- MsgBox("Record is not Deleted")
- End If
- MySqlConn.Close()
- End Sub
- End Class
Add Comment
Please, Sign In to add comment