Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

System.OverflowException: Value was either too large or too small for an Int16

3221393Apr 15 2016 — edited Apr 19 2016

Hi

I am trying to query a table with a column of type number(5,0). It seems like the default mapping for number(5,0) is Int16 (or "short"), which results in a System.OverflowException:

Value was either too large or too small for an Int16.

In the stacktrace I see, that it tries to convert an Int32 to Int16 which is odd.

If I go to the model browser and change the .NET runtime type to Int32 I instead get a System.Data.Entity.Core.MappingException:

Member Mapping specified is not valid. The type 'Edm.Int32[Nullable=False,DefaultValue=]' of member 'xxx' in type 'Model.xxx' is not compatible with 'OracleEFProvider.number[Nullable=False,DefaultValue=,Precision=5,Scale=0]'

Somehow it is not allowed to map a number(5,0) to Int32.

How do you overcome that problem?

Thanks!

This post has been answered by Alex Keh-Oracle on Apr 15 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2016
Added on Apr 15 2016
5 comments
3,360 views