title: how to reset Identity Column in C#?
body: <p>I have one question and I know the answer of my question, but I don't know why it doesn't execute it!</p>
  
  <p>My question is: I have a table. In table I have <code>ID</code>. If I delete rows from table so the IDs change. If I have this <code>(1,2,3,4)</code>. When I delete second row it becomes <code>(1,3,4)</code>. How to reset this id? I know the query is this:</p>
  
  <pre><code>DBCC CHECKIDENT ('T0', RESEED, 1)
  </code></pre>
  
  <p>...and I want to use this query in Visual Stdio 2013 using the c# language. This is my code:</p>
  
  <pre><code>SqlCommand cmd = new SqlCommand();
  cmd.Connection = con;
  con.Open();
  cmd.CommandText = "DBCC CHECKIDENT ('T0', RESEED, 1) ";
  cmd.ExecuteNonQuery();
  con.Close();
  </code></pre>
  
  <p>, but it is not working. What is problem?</p>