title: Updating a record using Linq-to-SQL
body: <p>I do my query...</p>
  
  <pre><code>var result = from u in tdc.tblUsers
               where u.UserID == userID
               select u;
  </code></pre>
  
  <p>and then I change the values I want to:</p>
  
  <pre><code>foreach (tblUsers u in result)
  {
       //change values (and no im not changing the primary key or foreign keys)
  }
  </code></pre>
  
  <p>then I submit changes</p>
  
  <pre><code>tdc.SubmitChanges();
  </code></pre>
  
  <p>When it hits submit changes, it throws exception that the row wasn't found or was changed. I am the only person using this so there's no other conflicts with accessing the db or locking. Why would it throw the <code>ChangeConflictException</code>? I have stepped through with debugger and the data persists all the way through the process, including the changes that I'm trying to make. </p>
  
  <p>I have also tried it this way before and got the same error</p>
  
  <pre><code>tblUsers result = (from u in tdc.tblUsers
                     where u.UserID == userID
                     select u).Single();
  result.Address = address;
  result.Phone = phone;
  tdc.SubmitChanges();
  </code></pre>
  
  <p>It will only ever retrieve 1 record with this query since <code>UserID</code> is the primary key.</p>
  
  <p>I've done this many times and it has worked. Every example I've found is exactly what I have.</p>