title: c# to Access INSERT INTO query not working
body: <p>I am trying to enter the value of a textbox in c# into a field in a database that I have in access. For some reason I keep getting the error saying:</p>
  
  <p>'An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll</p>
  
  <p>Additional information: Syntax error in INSERT INTO statement.'</p>
  
  <p>Can't quite see what is wrong, this is the first time I have attempted to do this in a project so I am not too experienced with it. This is my code:</p>
  
  <pre><code>OleDbConnection connection = new OleDbConnection(CONNECTION STRING GOES HERE);
  
  connection.Open();
  
  string playerName = textBox[i].Text;
  string query = "INSERT INTO (TotalPlayerName)(Player Name) VALUES(" + playerName + ")";
  OleDbCommand command = new OleDbCommand(query, connection);
  
  command.ExecuteNonQuery();
  </code></pre>
  
  <p>if it helps then the database is called 'Database' the table is called 'TotalPlayerName' and the field is called 'Player Name'</p>