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
|
Hey guys, I added a byte-based enum and imported it into Lightspeed. When I try to perform an add, I get an InvalidCastException even though the type on the User Defined Type is also set to byte. Works fine if the enum is a normal int-based enum. Here's the exception I get:
System.InvalidCastException : Specified cast is not valid.
at Mindscape.LightSpeed.Model.FieldModel. |
|
|
You will need to use a field converter to handle this as we expect Enum's to be int based even if they are a User Defined Type. There is some detail and a quick example of how to define this in the docs here: http://www.mindscapehq.com/documentation/lightspeed/Working-with-Legacy-Databases/Mapping-Database-Types-to-Domain-Types Once you have set up your converter you will want to attach it to your UDT under the Converter Type property.
|
|