Technology: LinQ to SQL
Problem: When inserting a record using LinQ to SQL in a table that has properly defined a column with an autogenerated ID, on submit linq to sql will thow the error:
Linq To SQL: Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF
This problem appeared when i was trying to delete all records of a relationship, and adding new ones. The relationship table had an Id column, which was not set
Solution: Apparently, linq to sql "mixed" the old records that i deleted with the new ones, so I solved the problem calling "submitChanges" after deleting the records of the relationship and before adding the new ones.
Suscribirse a:
Enviar comentarios (Atom)
It is useful to learn how to set and reset a error.Thank you author for posting this kind of error.
ResponderEliminarhttp://www.wikitechy.com/fix-error/error-cannot-insert-explicit-value-for-identity-column-in-table
Both are really good.
Cheers,
Venkat
her explanation designer replica luggage This Site dolabuy replica visit replica gucci
ResponderEliminarreview replica bags china this content replica wallets my site www.dolabuy.su
ResponderEliminarclick this replica bags discover this info here dolabuy ysl click to find out more best replica bags online
ResponderEliminarhop over to this site try this website see this website best replica designer bags click for more other
ResponderEliminarx2z53t0p80 w8v49g7l26 p4q32j3z39 s0n82q8d17 k7f45z0s05 v4s77v7n10
ResponderEliminar