title: SQL update not working
body: <p>I am trying to update my database using SQL commands but it is not working.</p>
  
  <pre><code>id = primarykey
  
  public void updateName(int id, string name)
  { 
      using(var cmd = new SqlCommand("UPDATE person SET name = @name where id = @id", connect()))
      {
          cmd.Parameters.AddWithValue("@id", id);
          cmd.Parameters.AddWithValue("@name",name);
          cmd.ExecuteNonQuery();
      }
  }
  
  private SqlConnection connect()
  {
      string conStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
      var c = new SqlConnection(conStr);
      c.Open();
      return c;
  }
  </code></pre>
  
  <p>What have I missed?</p>