This error occurs whenever i'm trying to run my program.
Additional information: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
The code is as follows:
private void create_Click(object sender, EventArgs e)
{
string MyConnectionString = "Server=x.x.x.x;Database=groupdes_New;Uid=root;Pwd=password;";
//create connection
MySqlConnection connection = new MySqlConnection(MyConnectionString);
//connect to database
connection.Open();
MySqlCommand cmd;
cmd = connection.CreateCommand();//create command
cmd.CommandText = "CREATE Table Newtable (" + "name" + ")";
cmd.ExecuteNonQuery();
if (connection.State == ConnectionState.Open)
{
connection.Close();
}
}
I still can't manage to solve this error. Thanks for the help!