Advertisement
Guest User

Untitled

a guest
Aug 4th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Private Sub cmbInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbInsert.Click
  2. If TextBox_A.Text <> "" And TextBox_B <> "" And TextBox_C.Text ="" And TextBox_D = "" Then
  3.  
  4. objconn = New MySqlConnection
  5. objconn.ConnectionString = "server=localhost; username=root; password=; database=red_cheese_pizza_database"
  6. objconn.Open()
  7. With objcmd
  8. .Connection = objconn
  9. .CommandText = "insert query here"
  10. .ExecuteNonQuery()
  11. End With
  12. objconn.Close()
  13. MsgBox("Data Added!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
  14.  
  15. ElseIf TextBox_C.Text <> "" And TextBox_D <> "" And TextBox_A.Text ="" And TextBox_B = "" Then
  16.  
  17. objconn = New MySqlConnection
  18. objconn.ConnectionString = "server=localhost; username=root; password=; database=red_cheese_pizza_database"
  19. objconn.Open()
  20. With objcmd
  21. .Connection = objconn
  22. .CommandText = "insert query here"
  23. .ExecuteNonQuery()
  24. End With
  25. objconn.Close()
  26. MsgBox("Data Added!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
  27.  
  28. End If
  29. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement