04-19-2012, 08:22 PM
please Help Me Vb this error on vb every time i launch the program and this is a sign in/ signup program
any when i sign up to my program this error it highlights
this :and it tells me my.Sqlexcption was unhandled the reson why is : the full code is here : please help me i need this for my real program plz someone help me
any when i sign up to my program this error it highlights
this :
Code:
data2 = command2.ExecuteReader()
Code:
Field 'Name' doesn't have a default value:
Code:
If Not TextBox6.Text = "puilia" Then
MessageBoxEx.Show("Enter the Picture Box Right!", "Box", MessageBoxButtons.OK, MessageBoxIcon.Warning)
conn = New MySqlConnection("server=db4free.net;Port=3306; user id=code; password=code; database=code")
Dim username As Boolean = True
conn.Open()
Dim sqlquery As String = "SELECT * FROM code DB WHERE Username = '" & TextBox1.Text & "';"
Dim data As MySqlDataReader
Dim adapter As New MySqlDataAdapter
Dim command As New MySqlCommand
command.CommandText = sqlquery
command.Connection = conn
adapter.SelectCommand = command
data = command.ExecuteReader
While data.Read()
If data.HasRows() = True Then
MessageBoxEx.Show("Username Is In Use", "Username", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
username = False
data.Close()
Else
data.Close()
username = True
End If
End While
data.Close()
If username = True Then
Dim sqlquery2 As String = "INSERT INTO code (Username, Password)VALUES ('" & TextBox1.Text & "','" & TextBox2.Text & "')"
Dim data2 As MySqlDataReader
Dim command2 As New MySqlCommand
command2.CommandText = sqlquery2
command2.Connection = conn
adapter.SelectCommand = command2
data2 = command2.ExecuteReader()
data.Close()
End If
End If