Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Data.SqlClient
- Dim connection As New SqlConnection("datasource=localhost;port=3306;username=root;password=;database=bukuakaunrumah")
- Dim command As New SqlCommand
- Private Sub FormDatabaseMySQL_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- End Sub
- Private Sub ButtonBack_Click(sender As Object, e As EventArgs) Handles ButtonBack.Click
- Me.Hide()
- FormFront.Show()
- End Sub
- Private Sub ButtonSubmit_Click(sender As Object, e As EventArgs) Handles ButtonSubmit.Click
- Dim command As New SqlCommand("INSERT INTO `accountinfo`(`AccountID`, `AccountName`, `AccountPassword`) VALUES (@accountID,@accountName,@accountPassword)", connection)
- command.Parameters.Add("@AccountID", SqlDbType.VarChar).Value = TextBoxID.Text
- command.Parameters.Add("@AccountName", SqlDbType.VarChar).Value = TextBoxName.Text
- command.Parameters.Add("@AccountPassword", SqlDbType.VarChar).Value = TextBoxPassword.Text
- connection.Open()
- If command.ExecuteNonQuery() = 1 Then
- MessageBox.Show("Successful Registered", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information)
- Else
- MessageBox.Show("Error")
- End If
- connection.Close()
- End Sub
- End Class
Add Comment
Please, Sign In to add comment