I'm currently having an issue I really can't fix, I've researched on the internet, but the suggestions I find just don't work for me.
I'm trying to make a registration system, just for fun not anything serious but I would gladly want to know what I'm doing wrong, since I could probably use this one day.
EDIT: I got the solution from @Gordon and many other suggestions which will probably be much usefull and i will look into trying all of the suggestions.
Thank you so much =)
And my code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
mysqlconn = New MySqlConnection
mysqlconn.ConnectionString = "server=localhost;userid=root;password=password;database=Mysql"
Dim Reader As MySqlDataReader
If TxT_User.Text = "" Or TxT_Pass1.Text = "" Or TxT_Pass2.Text = "" Or TxT_Email.Text = "" Or TxT_SC.Text = "" Then
MsgBox("You need to fill out the required informations above", MsgBoxStyle.Critical)
Else
If TxT_Email.Text.Contains("@") Then
If TxT_Pass2.Text = TxT_Pass1.Text Then
Try
mysqlconn.Open()
Dim Query As String
Query = "INSERT INTO syntax.members (Username, Password, Email, Secret Answer) VALUES ('" & TxT_User.Text & "', '" & TxT_Pass1.Text & "', '" & TxT_Email.Text & "', '" & TxT_SC.Text & "')"
cmd = New MySqlCommand(Query, mysqlconn)
Reader = cmd.ExecuteReader
MsgBox("Account created!", MsgBoxStyle.Information)
mysqlconn.Close()
Catch ex As MySqlException
MsgBox(ex.Message, MsgBoxStyle.Information)
Finally
mysqlconn.Dispose()
End Try
Else
MsgBox("Your Password doesn't match the retyped version", MsgBoxStyle.Critical)
End If
Else
MsgBox("Your email is not valid, please type a valid email address", MsgBoxStyle.Critical)
End If
End If
End Sub