title: Update local datatable from database
body: <p>I have been working on this problem for a few days and was hoping someone might have an answer.  I guess the more general description of the problem is that multiple users will access a database from multiple instances of an application and I would like to keep the local copy of the data as current as possible.  This is my current attempt at doing so, but I am open to any way of keeping the local copy in sync with the database.</p>
  
  <p>I have two data tables:<br>
  <strong>dtOriginal</strong> is loaded at the start of the application and the user is allowed to edit it.</p>
  
  <p><strong>dtFromDb</strong> is loaded when the user changes the displayed record on the form and it only contains the current values of the record now being displayed after the change.  </p>
  
  <p>I am attempting to update the dtOriginal table with those values from dtFromDb only if the row in dtOriginal is not marked as "modified".</p>
  
  <p>I have been attempting this with the merge method of the System.Data.DataTable class.</p>
  
  <pre><code>StronglyTypedDataTable dtOriginal = StronglyTypedDataTableAdapter.GetData();
  // User modifies one record through collectionview...
  // displayed record is then changed and the following occurs
  StronglyTypedDataTable dtFromDb = StronglyTypedDataTableAdapter.GetDataByID(currentID);
  dtOriginal.Merge(dtFromDb, true);
  </code></pre>
  
  <p>I would have expected that any rows which were marked as "unmodified" would have been updated with any new local values from the database if they had changed in another instance of the program and were propagated back to the database, but this is not the case.  It looks like dtFromDb does get the updated values from the DB, but I must not be using the merge method correctly as the updated values are not propagated to the local copy.</p>
  
  <p>Any ideas would be greatly appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Tyler</p>