Reactions to story from Omer van Kloeten's .NET Zen
Linq to SQL: ChangeConflictException With "WHERE 0 = 1"
http://weblogs.asp.net/ okloeten/ archive/ 2008/ 04/ 28/ 6139181.aspx
I just finished debugging a very annoying error, where I kept getting a ChangeConflictException with the message "Row not found or changed" while trying to update my data. I found that there were no Member Conflicts in the exception, which seemed really weird to me. When I set the Log property on my context, I found that Linq to SQL was using UPDATE statements that looked like this: UPDATE [dbo].[MyTable] SET [Col1] = @p0, [Col2] = @p1 WHERE 0 = 1 -- @p0: Input ... -- @p1: Input ... This was apparently some optimization made by the Linq to SQL team, but it gave me a clue as to where to look.
More rising blog posts
More rising news stories
-
Entertainment »
Husband Calls Shania Twain Split 'Unfortunate' -
Business »
U.S. stock indexes close mixed, but score solid weekly gains -
Lifestyle »
Fitch hikes Devon Energy to 'BBB+'; outlook stable -
Politics »
Dan Shefelman's 'Red and Blue' -
Sports »
NBA Joins Red Cross, UNICEF to Aid Asia Relief Efforts -
Technology »
The MySpace mom's prosecution threatens us all
Recent posts from Omer van Kloeten's .NET Zen
-
A Limitation of Lambda Expressions and Overloaded Extension Methods
9 days ago -
Linq: FirstOrFallback
23 days ago -
Linq Extensions Release 2 Now on CodePlex
23 days ago