Archives by Tag 'LINQ'

How does LINQ to SQL concurrency detect conflicts

By admin - Last updated: Friday, February 6, 2009

LINQ to SQL utlises optimistic concurrency control (OCC) to determine the conflicts.
OCC compares the loaded record to existing record before performing an update operation on the row so that the underlying conflicts could be detected.
The followings are steps to replicate the scenario,
Table Fruit

Id
Name
UnitPrice
Description

1
Apple
2.5
very long text

Step 1
Populate the fruit object from the database, and the object’s [...]

LINQ InsertOnSubmit, DeleteOnSubmit and SubmitChanges not working

By admin - Last updated: Sunday, February 1, 2009

I had the same problem with SQLExpress database file.
In one word, I looked at the records from the wrong database. There were actually two versions of the database file.
The mdf file gets copied over to bin\debug\data folder e.g. bin\debug\data\test.mdf after compilation, but I verify the data against the one within solution.
This likely happens when playing [...]