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, I got a table named TableA which has a column call Action with type [nvarchar(40) not null], and it also has an Id column as PK. I want to use enum type instead of String for column Action. My Enum looks like this:
I create the user defined type, and I set Action column of type ActionEnum. But I got the following exception: Unable to materialize field [Action] on type [TableA]. Check your table has an Id column and that your mappings are correct. See inner exception for details. And inner exception is: "Input string was not in a correct format.". I am using LS4 and SQL Server 2005. P.S If I use String type for Action column, that works fine. So how do I fix that please? Thanks Xiaosu |
|
|
I added a converter type for that Enum, and that works again. |
|
|
hi can you tell some information on how you converter type for that Enum? thanks :) |
|
|
Have a look at http://www.mindscapehq.com/documentation/lightspeed/Working-with-Models-in-the-Visual-Designer/enums-and-other-user-defined-types and look to see if the existing StringEnumFieldConveter class ( see: http://www.mindscapehq.com/Help/LightSpeed/html/TMindscapeLightSpeedFieldConvertersStringEnumFieldConverter1.htm ) will cover your needs.
|
|