I added a Stored Procedure to my Entity Model, and added it as an update stored procedure for my PRODUCT entity. The PRODUCT entity has a number of foreign keys pointing to other entities, which - according to error 2048, must be mapped into the stored procedures. I don't have access to modify the database, and the stored procedure doesn't accept parameters for some of the foreign key values (perfectly legal the way the database is set up).
Anyway, I found a fix to this problem which involved mapping the extra parameters into the stored procedure specification, and then set the command text to call the stored procedure without the extra parameters. I've tried, but the closest I've gotten so far is 'illegal variable name/number', which I'm recieving now. So, I guess my question is, what's wrong with my CommandText? Here it is:
USP_UPDATE_PRODUCT(:VAR1, :VAR2, :VAR3, :VAR4, :VAR5, :VAR6, :VAR7, :VAR8, :VAR9, :VAR10, :VAR11, :VAR12, :VAR13, :VAR14, :VAR15, :VAR16)
These are in the same order as they appear in the stored procedure declaration (the names have obviously been changed here, but you get the idea). Can I even do what I'm trying to do? here's a link to the article which gave me this lead (for the 2048 problem):
http://jamesmccaffrey.spaces.live.com/b ... 1161.entry
Thanks for any help![/url]
Error 2048 - Foreign Key Mapping and Stored Procedures
-
- Posts: 1
- Joined: Thu 23 Apr 2009 13:49
I have tried the workaround described in the post and succeeded.
Please check the parameters collection for the type and the names consistency.
If everything seems to be correct, then please send us (support * devart * com, subject "EF: SP parameters problem")
the script of your procedure and the model, we will check it out.
Please check the parameters collection for the type and the names consistency.
If everything seems to be correct, then please send us (support * devart * com, subject "EF: SP parameters problem")
the script of your procedure and the model, we will check it out.