MVC 2 Entity framework 4 how do I execute an insert stored procedure

MVC 2 Entity framework 4 how do I execute an insert stored procedure and pass parameters?
jonatecAsked:
Who is Participating?
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
All that is basically saying is that if you don't map the SELECT or UPDATE, but then attempt to Select or Update that model then the calls will fail because there will be no mapping.

As long as you understand that, and don't attempt a Select or Update, then you should be ok.
0
 
Carl TawnSystems and Integration DeveloperCommented:
Are you using ADO.Net or Entity Framework, or something else, or do you not mind?
0
 
jonatecAuthor Commented:
Entity Framework
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Carl TawnSystems and Integration DeveloperCommented:
You should be able to add a stored procedure to your model when you are defining it, in the same way that you would with a table.

For further reading check these:

    http://msdn.microsoft.com/en-us/library/bb896279.aspx
    http://learnentityframework.com/LearnEntityFramework/tutorials/using-stored-procedures-for-insert-update-amp-delete-in-an-entity-data-model/ 
0
 
jonatecAuthor Commented:
Thanks. At the Microsoft url you gave there is a comment:

"If you do not map all three of the insert, update, and delete operations  of an entity type to stored procedures, the unmapped operations will  fail if executed at runtime, and an UpdateException will be thrown."

Do you know how to set up just one stored procedure for an insert and not set up sprocs for update and delete ?
0
 
jonatecAuthor Commented:
Yeah, that's excellent thanks !!!
0
All Courses

From novice to tech pro — start learning today.