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
|
Hello! I dont know why but I'm getting error:
while adding new row to DB. Could this be related to identity method? In Lightspeed designer table has Identity type set to Int32 (which is true for this table) but Unitofwork has set IdentityMethod = IdentityMethod.GuidComb. Thanks |
|
|
Yes, I think that is probably the problem. The GuidComb identity method is returning a Guid, and LightSpeed is trying to convert that to an Int32. Even if that did work, the results would be garbage! So what you need to do is override the default identity method (the one specified in the LightSpeedContext) for this particular entity type, and substitute an identity method that returns something convertible to Int32. To do this, select the entity in the designer, go to the Properties window and select an Identity Method of KeyTable, Sequence or IdentityColumn (depending on your database and not forgetting to create the key table, sequence or autoincrement column if required). This will make LightSpeed use this integer identity method for this entity/table only -- other tables will continue to use the identity method specified in the LightSpeedContext (GuidComb in your case). |
|
|
Thanks. I was looking for something like this ("Identity method") in designer view and I don't know why I didnt saw that property before. |
|
|
One thing more. I had previously set global IdendityMethod to GuidComb and I tryed to execute query similar to this:
Right now I'm not sure but I think there was no error when query was executed (I think there should be error telling that provided Identifier is not a Guid type since global IdentityMethod is GuidComb). I will check this tomorrow. |
|