Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub cmbInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbInsert.Click
- If TextBox_A.Text <> "" And TextBox_B <> "" And TextBox_C.Text ="" And TextBox_D = "" Then
- objconn = New MySqlConnection
- objconn.ConnectionString = "server=localhost; username=root; password=; database=red_cheese_pizza_database"
- objconn.Open()
- With objcmd
- .Connection = objconn
- .CommandText = "insert query here"
- .ExecuteNonQuery()
- End With
- objconn.Close()
- MsgBox("Data Added!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
- ElseIf TextBox_C.Text <> "" And TextBox_D <> "" And TextBox_A.Text ="" And TextBox_B = "" Then
- objconn = New MySqlConnection
- objconn.ConnectionString = "server=localhost; username=root; password=; database=red_cheese_pizza_database"
- objconn.Open()
- With objcmd
- .Connection = objconn
- .CommandText = "insert query here"
- .ExecuteNonQuery()
- End With
- objconn.Close()
- MsgBox("Data Added!", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "SUCCESS")
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement