This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, LS4 is attempting to update a SQL Server identity column (and failing with 'Cannot insert explicit value for identity column in table ... when IDENTITY_INSERT is set to OFF'). The value it tries to set is zero, as the field is an Int32 which has never been set in our code. In the model, it has LoadOnly set to true which I'm assuming should prevent this sort of thing. The generated code in the model provides only a getter:
This identity column is not the table's primary key (that is a composite key of two GUIDs). Any idea why LightSpeed is trying to set a value here? Cheers, -- John |
|
|
Yes, this should not be trying to set a value here. LoadOnly will mark the field as read only and the property as you have indicated only has a get implementation so LightSpeed should be ignoring this for inserts/updates. Are you able to extract out just that entity into a small repro (presumably trying to insert or update or both triggers this?) which we could have a look at?
|
|