I\'m having some troubles with updating linq to sql entities.
For some reason, I can update every single field of my item
entity besides name.
It sounds like your DBML might be out of synch. You should delete the tables and re-add them and try and run it again.
Just delete your Items
table manually and re-add it.
EDIT: Based on your edit, you should check out the following thread regarding GetHashCode
.
http://social.msdn.microsoft.com/forums/en-US/linqtosql/thread/6cc6c226-f718-4b22-baad-dba709afe74b/
.Net rules claim that GetHashCode() and Equals() must always be implemented in tandem. Two objects that are equal must have the same hash code.
Also, the combination of GetHashCode() + Equals() forms the entity's concept of identity. If you make it based on field values (other than PK) then the identity changes as you change the fields. This is bad if L2S must lookup other info in a dictionary based on the entity's identity, and especially if L2S needs to find an entity in its identity cache!
Advice: don't change the identity of an entity. L2S expects it to be based on the object's natural (address based) identity.
It appears that the SQL being generated is not including the contents of the SET
clause (notice that there is no [Name] = @pXX
after SET
). Are all of the properties (data type, size, etc.) of the entity field set correctly in the dbml designer?