This is my code and I dont know why I'm getting this Error in my visual studio 2013 and my data base is MySQL Query Browser:
"Additional information: ERROR [HY000] [MySQL][ODBC 3.51 Driver][mysqld-5.1.34-community]Data truncated for column 'userid' at row 1"
If a = "New" Then Dim sqlstring As String sqlstring = "INSERT into users(username, userid, usertype, remarks)values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & ComboBox1.Text & "','" & TextBox4.Text & "')" cmd = New Odbc.OdbcCommand(sqlstring, cnn) cmd.ExecuteNonQuery() reset() disable() btn3() End If
Odbcshould be your last choice for an ADO.NET provider. If you're using MySQL then, if you can, you should download Connector/Net from the MySQL web site and use that.MySqlClientis a MySQL-specific provider, just asSqlClientis specific to SQL Server. You can also download some MySQL-specific tools for VS that support EF and such.