This is a migrated thread and some comments may be shown as answers.

Primary Keys and Decimal data type

1 Answer 277 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel Woodard
Top achievements
Rank 1
Daniel Woodard asked on 24 Nov 2010, 02:21 AM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Thomas
Telerik team
answered on 24 Nov 2010, 11:09 AM
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,
Thomas
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Databases and Data Types
Asked by
Daniel Woodard
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Share this question
or