04-20-2012, 03:23 PM
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,
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.
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.