Syntax error in insert into statement happens while I try to update my MS Access database.
- Database name = student
- Table name = student table
Code:
private void button1_Click(object sender, EventArgs e)
{
connection.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connection;
command.CommandText = "INSERT INTO student table([Name],[Class])" + "values('" + textBox1 + "','" + textBox2 + "')";
connection.Close();
command.ExecuteNonQuery();
MessageBox.Show("Data Saved");
}
Student Table
orStudent
? - Tim Schmelter