title: Update a row in ASP.NET and MVC LINQ to SQL
body: <p>I have a simple row that has 4 columns:</p>
  
  <pre><code>{ [Primary Key Int]RowID, [text]Title, [text]Text, [datetime]Date }
  </code></pre>
  
  <p>I would like to allow the user to edit this row on a simple page that has a form with the fields "Title" and "Text".</p>
  
  <p>There is a hidden field to store the RowID.</p>
  
  <p>When the user posts this form to my controller action, I want it to update the row's Title and Text, and keep the Date the same. I don't want to have to explicitly include a hidden field for the Date in the form page.</p>
  
  <p>Here is my action:</p>
  
  <pre><code>[AcceptVerbs(HttpVerb.Post)]
  public ActionResult EditRow(Row myRow)
  {
      RowRepository.SaveRow(myRow)   
      return View("Success");
  }
  </code></pre>
  
  <p>RowRepository:</p>
  
  <pre><code>public void SaveRow(Row myRow)
  {
      db.MyRows.Attach(myRow);
      db.Refresh(RefreshMode.KeepCurrentValues, myRow);
      db.SubmitChanges();
  }
  </code></pre>
  
  <p>This dosen't keep the "Date" value already in the row and tries to insert a value that throws an timespan exception.</p>
  
  <p>How can I just tell it to keep the old values?
  I tried doing <code>RefreshMode.KeepChanges</code> and nothing.</p>