I am trying to update records with linq to sql. The code does not throw any errors, but the changes are not getting to the database. I don’t know how to debug this problem. Object tracking is enabled for the datacontext, as suggested here LINQ to SQL database row not updating
I am confident that my datacontext is pointing to the correct database.
Dim myAverageWeeklyLab As AverageWeeklyLab = (From l In myAlexanderValidation.AverageWeeklyLabs Where l.labname = lab).First
myAverageWeeklyLab.GracePeriod = standardDeviation
myAlexanderValidation.SubmitChanges() //this should set the gracePeriod field=standardDeviation, but does not
What am I missing? What steps can I take to debug this problem?
Ensure your table as a primary key.