please Help Me Vb sign up with MySql.Data.MySqlClient - Printable Version +- BP Forums (https://bpforums.info) +-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55) +--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56) +---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8) +---- Thread: please Help Me Vb sign up with MySql.Data.MySqlClient (/showthread.php?tid=518) |
please Help Me Vb sign up with MySql.Data.MySqlClient - hohoswithcans - 04-19-2012 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 : Code: data2 = command2.ExecuteReader() Code: Field 'Name' doesn't have a default value: Code: If Not TextBox6.Text = "puilia" Then Re: please Help Me Vb sign up with MySql.Data.MySqlClient - brandonio21 - 04-20-2012 Well, the problem is not with your VB.NET code, but actually lies within your MySQL database itself. When you update the table code with this line, Code: Dim sqlquery2 As String = "INSERT INTO code (Username, Password)VALUES ('" & TextBox1.Text & "','" & TextBox2.Text & "')" You do not specify a value for the "Name" field in your database table. And your name field does not know what to do if a value is not specified, so it throws you this error. There are two main ways to solve this. Option 1. When you make your INSERT code call, specify a value for the Name field Option 2. Set a default value for the name field in your DB4FREE Settings. |