title: Incrementing an int during insert
body: <p>I'm trying to increment an integer in an MS Access table from a c# .net page during insert.</p>
  
  <p>I'm getting a syntax error when attempting the following. Also unsure if I should be using an <code>ExecuteNonQuery()</code> or not?</p>
  
  <pre><code>OleDbCommand cmd = new OleDbCommand("INSERT INTO tblTarget(target,ref) VALUES(@target,(SELECT MAX(ref)+1 FROM tblTarget)", conn);
  
  cmd.Parameters.AddWithValue("@target", TextTitle.Text);
  conn.Open();
  cmd.ExecuteNonQuery();
  conn.Close();
  </code></pre>