title: get last identity of table
body: <p>I am trying to get the last identity of my table <code>image</code>.</p>
  
  <p>The following code isn't working:</p>
  
  <pre><code>SqlConnection connection = new SqlConnection(ConfigurationManager.AppSettings["DSN"]);
  SqlCommand ident = new SqlCommand("SELECT IDENT_CURRENT(‘image’)", connection);
  connection.Open();
  id = Convert.ToInt32(ident.ExecuteScalar());
  </code></pre>
  
  <p>I need this so that even if I delete the last row I can get the last autogenerated identity.</p>