Getting Error Specified cast is not valid in Materializer

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
abhinay_agrawal
Posts: 9
Joined: Wed 07 Oct 2009 14:09

Getting Error Specified cast is not valid in Materializer

Post by abhinay_agrawal » Wed 07 Oct 2009 14:15

Hi,

I am working on Materializer while mapping result of Stored procedure through it's giving me Error

Specified cast is not valid

during debuging I observed that reader is giving field type as Double but while generating entity frame work it's giving Data Type value as Long so might be this is the cause of problem.

Can any one suggest me how to resolve this error
I am having column field in Oracle as

OrderID number(10)

in Entity Framework generate code it's having Long

Thanks,
Abhinay.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 08 Oct 2009 12:33

The problem seems to be associated with the Reader.GetValue() usage.
I recommend you to change the Materializer code in order to fix the problem.
If this advice is not helpful, please send us (support * devart * com, subject "EF Materializer")
a small test project illustrating the issue. Please include the script of DB objects to the project.

abhinay_agrawal
Posts: 9
Joined: Wed 07 Oct 2009 14:09

Post by abhinay_agrawal » Fri 09 Oct 2009 05:13

AndreyR wrote:The problem seems to be associated with the Reader.GetValue() usage.
I recommend you to change the Materializer code in order to fix the problem.
If this advice is not helpful, please send us (support * devart * com, subject "EF Materializer")
a small test project illustrating the issue. Please include the script of DB objects to the project.
Hi ,
When I am altering my table with number(10) to number(38) it's changing datatype in entity framework from long to decimal and it's working means this problem is not due to Reader.GetValue() might be there is some problem in datatype mapping while autogenerating edmx from DBase.

Can any one let me know is this a bug or any work around to this.

Thanks,
Abhinay.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 13 Oct 2009 08:50

Please send me (support * devart * com, subject "EF Materializer") a small test project illustrating the problem, I'll look into it.

Post Reply