I have a table with several columns, and I want to update only one column. I am writing a method that first retrieves a record and then updates it by changing the value of the column. Like this:
using (myDC...)
{
var recordInDB = (from...
where ....
select r).SingleOrDefault();
if (recordInDB != null)
{
recordInDB.MyColumn = newValue;
myDC.SubmitChanges();
}
Does it remain to save all the other columns and update only the ones I want to change, or will this clear all the columns and update the MyColumn column with a new value?
source
share