First of all, I have read the similar posts and don't see how they solve this problem. If I'm missing something in them, please point out what.
My Linq code is very similar to Scott Gu's expensiveUnpopularProducts example. However, in my case, the database is not being updated with the new value. There are no exceptions raised, and all of the variables seem to have reasonable values in the debugger (result set populated, connection string correct, ...).
using (MyDataContext db =
new MyDataContext(CONNECTION_STRING))
{
var resultSet = from l in db.Logs
where l.ProcessCode == null
select l;
foreach (var bm in resultSet)
{
bm.ProcessCode = 1;
// Debugger shows bm.ProcessCode properly set
}
db.SubmitChanges();
}
Why might SubmitChanges() not cause the DB to be updated?
NOTE: This is a simplified case of my real method. The real one also inserts records into another table. That insert is working, so I'm sure the connection string is correct and functioning.