views:

118

answers:

1

Hello all, im trying to test and then implement LINQ 2 SQL as my Data Access to my N-Tier Application, as i read some info today, i added to my database a DateTime column as this reflected in my L2S Designer i changed the TimeStamp property of each "column" in the designer to true and this forced AutoGenerated Value to true as well. But when i attach my Object back to the datacontext i get "Members 'System.DateTime ModifiedDate' and 'System.Data.Linq.Binary TimeStamp'" both marked as row version. InvalidOperationException.

I have this feeling because i added this column as ALLOW NULL because i have rows and i just don't want to delete them, could take part in this. I also when i try to update the object i don't send the ModifiedDate with it and gets the default value. This could cause a concurrency issue i guess, but I'm not there yet.

I just want to update it for now with no action on concurrency exception. But, another step will be to handle this things.

Any ideas?

+1  A: 

One problem you might have is that a DateTime column is not a Timestamp column. If you added a DateTime column for L2S concurrency checking, you should have made the column a Timestamp column, not a DateTime column.

Randy

Randy Minder
Thank you that's it. I now get a ChangeConflictException, that seems to want to handle Concurrency issue. Bad news is System.Data.Linq not supported in CF 3.5 and so concurrency conflicts cant managed by Linq 2 SQL out of the box :)