Primary Keys and Decimal data type

2 posts, 1 answers
  1. Daniel Woodard
    Daniel Woodard avatar
    13 posts
    Member since:
    Aug 2005

    Posted 23 Nov 2010 Link to this post

    I have serveral tables (in a SQL Server 2008 database) with a primary key of type DECIMAL(16,0).  After generating the mappings using the ORM tool, the primary keys get mapped to Int64.  This all seems fine, however, when I go to actually pull data, I get an this exception:

    Type converter initialization failed for column System.String decimal[DECIMAL](16) null. The named converter does not handle CLR type .
    Parameter name: convertName
    Actual value was OpenAccessRuntime.Data.DecimalConverter, Telerik.OpenAccess.Runtime, Version=2010.3.1110.3

    If I manually change the mapping to DECIMAL type, then I get this error at build time:

    Error 3
    Field: 'System.Decimal DataLibrary.Org::orgId': The type of single field identity field must be System.Byte, System.Int16, System.Int32, System.Int64, System.Guid, System.Char or System.String.

    Either way I am stuck.

    Any way to use a DECIMAL type as a primary key?
  2. Answer
    Thomas avatar
    588 posts

    Posted 24 Nov 2010 Link to this post

    Hello Daniel Woodard,

    I think you have hit an issue with the latest build that got fixed in the mean time. The upcoming patch (scheduled for today, latest tomorrow) will contain the necessary changes. After that, you will be able to use the the field with Int64 type.

    Thanks for your understanding,
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  3. DevCraft banner
Back to Top