New Posts New Posts RSS Feed: Can't return boolean or int (scalar values) from stored procedure Error in object mapper tool: TypeName does not contain namespace when adding stored procedure
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Can't return boolean or int (scalar values) from stored procedure Error in object mapper tool: TypeName does not contain namespace when adding stored procedure

 Post Reply Post Reply
Author
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Topic: Can't return boolean or int (scalar values) from stored procedure Error in object mapper tool: TypeName does not contain namespace when adding stored procedure
    Posted: 14-May-2009 at 6:41pm
Currently, neither the Entity Framework nor DevForce supports returning scalars or primitive (built-in) types from a stored procedure.  The DevForce error is unfortunately a little misleading, but if it generated successfully you would still get an error at run time.
 
EF 4.0 (and therefore DevForce.vNext) will support scalar and primitive return types. 
 
Back to Top
adam View Drop Down
Newbie
Newbie


Joined: 12-May-2009
Posts: 7
Post Options Post Options   Quote adam Quote  Post ReplyReply Direct Link To This Post Posted: 14-May-2009 at 12:40pm
(to be fair, I just checked the designer.cs file that the .edmx creates, and it seems to ignore creating any code when the return type is a built in type! When I change the return type of the "function import" to be a custom entity type, it generates code in the edmx designer.cs file [and likewise in the dev force designer.cs file]. Does this mean that built-in types from stored procedures are not supported by Microsoft Entity Framework too????) Adam :)
Back to Top
adam View Drop Down
Newbie
Newbie


Joined: 12-May-2009
Posts: 7
Post Options Post Options   Quote adam Quote  Post ReplyReply Direct Link To This Post Posted: 14-May-2009 at 12:08pm
Hi,
 
We've just added our first stored procedure to our edmx file (we used the "function import" feature and set the return type to Boolean). It is a fairly straightforward stored proc that returns a single column and single row (i.e., a scalar value). The value in that one column is a boolean (bit). The .edmx file translates this into a return type of Collection(Boolean) when we look at the xml... When saving the .edmx, we said "OK" to update our DevForce model.
 
Next, we open our DevForce EF Object Mapper tool and click save, and we get the following error:
 
"Failed to save model file:  'C:\... [foo].ibedmx'
TypeName: 'Boolean' does not contain namespace: '[blah]'
 
It's as if the DevForce object mapper tool does not know what to do with a return type of Collection(Boolean). We get the same error when we change the return type to Int32 (or any built in System type).
 
When we change the return type to be one of our custom Entity types, the DevForce EF Object Mapper tool is happy.
 
Does this mean that DevForce does not support returning built in types (such as boolean and int32) from stored procedures????! Could this be?
 
Adam :)
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down