Page 1 of 1

Error in stored procs with EF 4

Posted: Sun 14 Mar 2010 14:48
by ramana.bhavaraju
Hi,

We were using EF version 1 with dotconnect for oracle . We moved to VS 2010 RC and have our model project targeting .net framework 3.5. Everything was working. Once we moved our model project to 4.0 and changed our edmx to EF4 and installed the latest devart 5.60.102... the stored procedure calls are giving an error saying
"The type of key field ObjectId is expected to be of type Int64, but the value provided is of type decimal"... I dont get this error is i revert it back to .net framework 3.5. Please let me know what is happening here

Thanks,
Ramana

Posted: Mon 15 Mar 2010 15:31
by ramana.bhavaraju
Hi,

I found the problem to the issue but still not sure how it worked till now. So please let me know if something changed in devart with this new release. Previously the ObjectId(our primary key) is of type Int64 in the edmx and of type number(19,0) in the oracle database. Devart magically figured this out when running the stored procs and did the conversion without complaining. But now it blows up. PLease let me know why this is happening as we cannot make the ObjectId as a decimal in the edmx and it should be as Int64.

Thanks
Ramana

Posted: Mon 15 Mar 2010 16:00
by AndreyR
Could you please send me (support * devart * com, subject "EF4: SP Type mismatch") the scripts of the objects causing the problem?
I'm unable to reproduce it.

Posted: Mon 15 Mar 2010 16:17
by ramana.bhavaraju
Sent the email with the edmx...i did not send the sql script..because it is too big with all our tables and stored procs..

Posted: Tue 16 Mar 2010 17:40
by ramana.bhavaraju
Any luck with my issue..this is a show stopper for us...please let me know whats happening. When we changed all the Primary keys and foriegn keys in my edmx to decimal ...it works..

Thanks
Ramana

Posted: Thu 25 Aug 2011 18:20
by Anchor
Has there been any luck on this? I think I have a similar problem? I am trying to get an entity back from a stored procedure but I get this error...

"The type of the key field 'USER_ID' is expected to be 'System.Int64', but the value provided is actually of type 'System.String'"

It seems like the my database table does not match up with my entity, like the stored procedure is trying to take data from the Address field in the DB table and stuff it into the UserID field in the entity.

It's gotta be either going from the .NET 3.5 to 4.0 or from devart dotConnect for Oracle 5.1 to 6.3 that is causing the problem.

Posted: Wed 31 Aug 2011 12:22
by Shalex
As we understood, you are using stored procedure that returns result set via cursor. Are you working with EDMX? Try setting explicit mapping of column names, which are returned in cursor, to properties of entity/ComplexType, cursor is mapped to: select necessary Function Import, set Mapping Details in the window. This functionality was implemented in EFv4.

If this doesn't help, please send us a small test project with the corresponding script of the database objects.