Stored procedure has to many arguments specified entity framework


Question

I'm using Entity Framework 6 with Stored Procedures mapping. I have an insert sp with 6 parameters for the insert. The entity that I insert has 8 properties where one property is the Id.

The problem is that I get this error:

Procedure or function sp has too many arguments specified

The reason why I won't insert the last property is because this would have a default value of 0 (bit) and another system would change that bit.

When I use NotMapped as attribute above the property the sp is succeeding but then I'm unable to query the data out of the system.

So is there someway I could ignore a parameter?

Popular Answer

Ok, you say you have a Stored Procedures with 6 parameters for the insert and that the entity that you are inserting has 8 properties where one property is the Id.

So that leaves you with 7 properties, right? but the Stored Procedure has 6 parameters!, so clearly the Procedure or function sp has too many arguments specified

Ok may be you could have a look at this http://hammadk.wordpress.com/2012/01/27/solved-procedure-xxx-has-too-many-arguments-specified-asp-net/





Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why