I am trying to create a table in a previously created database.
Here is my code:
private void button2_Click(object sender, EventArgs e)
{
label8.Text = textBox2.Text;
label8.Visible = true;
MySqlConnection connection = new MySqlConnection("datasource=localhost;port=3306;username=root;password=root");
MySqlCommand command = new MySqlCommand("CREATE TABLE " + label8.Text + "(Team Name VARCHAR(20) NOT NULL, Wins INT(2) NULL, Place INT(2) NULL AUTOINCREMENT", connection);
connection.Open();
command.ExecuteNonQuery();
textBox3.Enabled = true;
connection.Close();
}
I am currently getting the following error:
MySql.Data.MySqlClient.MySqlException: '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 'Name VARCHAR(20) NOT NULL, Wins INT(2) NULL, Place INT(2) NULL AUTOINCREMENT' at line 1'
Does anyone know how to fix this?