title: Get RecordId from table
body: <p>I am new to SQL, I have table with <code>RecordId</code> that is incremented automatically and is primary key. I would like to get <code>RecordId</code> of the row that was inserted into table.
  Thanks in advance for help.</p>
  
  <pre><code>myCommand.CommandText = "INSERT INTO " + tableName + " (DateRaised,RaisedBy,WeekNo,Platform,Department,Site,Process, Area,NavErrorNo,RootCauseDescription,Status) " +
      "VALUES ('" + currentDate.ToString(format) + "','" +
      sender + "'," +
      weekNumber + ",'" +
      comboBoxPlatform.SelectedItem + "','" +
      comboBoxDepartment.SelectedItem + "','" +
      comboBoxSite.SelectedItem + "','" +
      comboBoxProcess.SelectedItem + "','" +
      comboBoxArea.SelectedItem + "','" +
      textBoxNavError.Text + "','" +
      textBoxIssue.Text + "','Open')";
  //int lastInsertedId = 
  myCommand.ExecuteNonQuery();
  </code></pre>
  
  <p><code>lastInsertedId</code> should be int from <code>RecordId</code> in my table.</p>