Update through Linq-to-SQL DataContext not working.
- by Puneet Dudeja
I have created a small test for updating table using Linq-to-SQL DataContext as follows:
using (pessimistic_exampleDataContext db = new pessimistic_exampleDataContext())
{
var query = db.test1s.First(t => t.a == 3);
if (query.b == "a")
query.b = "b";
else
query.b = "a";
db.SubmitChanges();
}
But after executing this…