I've got an error message:
System.Data.OleDb.OleDbException: 'Syntax error in INSERT INTO statement.'
I've read through multiple questions like this, but non of their answers helped me.
This is my code:
conn.Open();
string sql = "";
sql = "insert into player(Username, Password) values(@Username, @Password)";
using (command = new OleDbCommand(sql, conn))
{
command.Parameters.AddWithValue("@Username", textBoxUsername.Text);
command.Parameters.AddWithValue("@Password", textBoxPassword.Text);
command.ExecuteNonQuery();
}
command.Dispose();
conn.Close();
The error is in the following line:
command.ExecuteNonQuery();
Does anyone know a solution for this error?
Thanks in advance!