title: SQL error: Incorrect syntax near the keyword 'User'
body: <p>I am using SQL to insert data to SQL Database file using C# as follows.</p>
  
  <pre><code>    String cs = System.Configuration.ConfigurationManager.ConnectionStrings["connection1"].ConnectionString;
      SqlConnection conn = new SqlConnection(cs);
      String sql = "INSERT INTO User (login, password, status) " + 
              "VALUES (@login, @password, @status)";
      SqlCommand comm = new SqlCommand(sql, conn);
  
      comm.Parameters.Add("@login", System.Data.SqlDbType.VarChar);
      comm.Parameters.Add("@password", System.Data.SqlDbType.VarChar);
      comm.Parameters.Add("@status", System.Data.SqlDbType.Bit);
  
      try
      {
          conn.Open();
          Console.WriteLine(conn.ToString());
          comm.ExecuteNonQuery();
          conn.Close();
          return true;
      }
      catch (Exception ex)
      {
          throw (ex);
      }
      finally
      {
          conn.Close();
      }
  </code></pre>
  
  <p>I am  getting the following error when command is executing.</p>
  
  <blockquote>
    <p>Incorrect syntax near the keyword
    'User'.: INSERT INTO User (login,
    password, status) VALUES (@login,
    @password, @status)</p>
  </blockquote>
  
  <p>How can I solve this please?</p>
  
  <p><strong>edit:</strong>
  missed parameter values added..</p>
  
  <pre><code>    comm.Parameters["@login"].Value = this.Username;
      comm.Parameters["@password"].Value = this._password;
      comm.Parameters["@status"].Value = this.Status;
  </code></pre>