title: How to find number of rows affected in LINQ to SQL?
body: <p>Does anybody know how to find the number of rows affected AFTER I have submitted changes to the data context in LINQ to SQL?</p>
  
  <p>At first I was doing something like this:</p>
  
  <pre><code>Using db as New MyDataContext()
      db.Users.Attach(modifiedUser, True)
      db.SubmitChanges()
  
      Dim rowsUpdated As Integer = db.GetChangeSet().Updates.Count
  End Using
  </code></pre>
  
  <p>I have since figured out that this doesn't work and that</p>
  
  <pre><code>db.GetChangeSet().Updates.Count
  </code></pre>
  
  <p>Only tells you how many updates there will be BEFORE you call SubmitChanges().</p>
  
  <p>Is there anyway to find out how many rows have actually been affected?</p>