Skip to content

Instantly share code, notes, and snippets.

@ibanezmatt13
Last active December 19, 2015 19:38
Show Gist options
  • Save ibanezmatt13/6007325 to your computer and use it in GitHub Desktop.
Save ibanezmatt13/6007325 to your computer and use it in GitHub Desktop.
Imports MySql.Data
Imports MySql.Data.MySqlClient
Imports System.Data.SqlClient
Module Module_Create
Dim dbCon As MySqlConnection
Dim strQuery As String = ""
Dim SQLCmd As MySqlCommand
Dim DR As MySqlDataReader
Dim entered_email As String = ""
Dim entered_password As String = ""
Dim database_email As String = ""
Dim database_password As String = ""
Public Sub GetDBData()
Try
dbCon = New MySqlConnection("Server=localhost;Port=3306;Database=account_holders;Uid=root;Pwd=2000abcd2000cdd2000ef13445adf2000acd")
strQuery = "INSERT INTO credentials(FirstName, Surname) VALUES('@FirstName, @Surname)"
dbCon.Open()
SQLCmd = New MySqlCommand(strQuery, dbCon)
With SQLCmd.Parameters
.Add(New SqlParameter("@UserName", CreateAccount.TextBoxFirstName.Text))
.Add(New SqlParameter("@Password", CreateAccount.TextBoxSurname.Text))
End With
SQLCmd.Connection = dbCon
SQLCmd.ExecuteNonQuery()
dbCon.Close()
Catch ex As Exception
MessageBox.Show("Error" & vbCrLf & ex.Message)
End Try
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment