title: How to insert a row with "autonumber" field (ID column) into Access Database/ C# ASP.NET
body: <p>This is my first time working with DB.
  I've decided to create a DB with two tables - "Team", "Player"
  I want to add a new player to the "Player" table.
  The "Player" table consists of the following columns: ID(autonumber), FirstName, LastName, TeamID</p>
  
  <p>In order to do so, I've created three text boxes for the FirstName, LastName, TeamID
  Note that I did not treat the "ID" since it's an autonumber and should be added automatically
  The Button1_click should add the new row eventually.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>    protected void Button1_Click(object sender, EventArgs e)
      {
          try
          {
              connection = new OleDbConnection(connectionString);
          }
          catch
          { }
          try
          {
              connection.Open();
  
              OleDbCommand command = new OleDbCommand("INSERT INTO Player VALUES ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "')");
  
              command.ExecuteNonQuery();
  
              connection.Close();
  
          }
          catch
          { }
  </code></pre>