This is continue from part 2 (Reading from LINQ to Entities). The code will work for both .NET Framework 3.5 or 4.0.
The complete code.
//Define an entity object
BeancurdEntities entBC = new BeancurdEntities();
//Get the unique row to update
Beancurds bc = entBC.Beancurds.First(b => b.BeancurdID == 1);
//change the quatity and update the row
bc.Qty = 9;
The code above changes the quatity of the beancurd where the beabcurd ID is equal to 1.