jonatec
asked on
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?
Are you using ADO.Net or Entity Framework, or something else, or do you not mind?
ASKER
Entity Framework
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/
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/
ASKER
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 ?
"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 ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yeah, that's excellent thanks !!!