title: Oledb Update command
body: <p>I make a program that saves and update a data from the database, I can save and read data, I can also update but the problem is, I can't select the <code>"ID"</code> as the index, here is my sample code using <code>"ID"</code> as the index,</p>
  
  <pre><code>cmd = new OleDbCommand();
  cmd.CommandType = CommandType.Text;
  cmd.CommandText = "UPDATE Records SET FirstName = @firstname, LastName = @lastname, Age = @age, Address = @address, Course = @course WHERE [ID] = @id";
  cmd.Parameters.AddWithValue("@id", int.Parse(label7.Text));
  cmd.Parameters.AddWithValue("@firstname", textBox1.Text);
  cmd.Parameters.AddWithValue("@lastname", textBox2.Text);
  cmd.Parameters.AddWithValue("@age", textBox3.Text);
  cmd.Parameters.AddWithValue("@address", textBox4.Text);
  cmd.Parameters.AddWithValue("@course", textBox5.Text);
  cmd.Connection = cn;
  cn.Open();
  cmd.ExecuteNonQuery();
  {
      MessageBox.Show("Update Success!");
      cn.Close();
  }
  </code></pre>
  
  <p>and here is my update code that works, but the index is the <code>"firstname"</code>,</p>
  
  <pre><code>cmd = new OleDbCommand();
  cmd.CommandType = CommandType.Text;
  cmd.CommandText = "UPDATE Records SET FirstName = @firstname, LastName = @lastname, Age = @age, Address = @address, Course = @course WHERE FirstName = @firstname";
  //cmd.Parameters.AddWithValue("@id", int.Parse(label7.Text));
  cmd.Parameters.AddWithValue("@firstname", textBox1.Text);
  cmd.Parameters.AddWithValue("@lastname", textBox2.Text);
  cmd.Parameters.AddWithValue("@age", textBox3.Text);
  cmd.Parameters.AddWithValue("@address", textBox4.Text);
  cmd.Parameters.AddWithValue("@course", textBox5.Text);
  cmd.Connection = cn;
  cn.Open();
  cmd.ExecuteNonQuery();
  {
      MessageBox.Show("Update Success!");
      cn.Close();`
  }
  </code></pre>
  
  <p>It works but the problem is I can't update the <code>"FirstName"</code>, Is there a way that I can also update the Firstname? or use the <code>"ID"</code> as the index? thanks</p>