Reputation: 21
I had added the Stored procedure in my Entity framework and i also imported the functions in the edmx. Is it must to add all the three functions insert, update, and delete functions to a table. I had tried with insert alone and also with all, but why can't i get the name of the stored procedure in the connection string.
Let me know what i done clearly.
i had also mapped the insert, update and delete function to the table with return type only for insert and update. Still i can't get the name of SP in the connection string.
Please let me know how could i resolve this issue. Thanks in Advance, Kamal.
Upvotes: 0
Views: 2014
Reputation: 5123
It is not clear what issue you are trying to resolve.
Connection strings have nothing to do with stored procedure's names. They are used to store information about connection, which is sent to an sql server instance, when you are about to establish a connection.
Why do you care about getting a stored procedure's name at runtime in the first place? If you are just mapping procedures to insert/update/delete operations, they will be called automatically, when the appropriate operations are triggered.
As to the required mappings, as far as i remember, you can map insert operation alone (at least in EF 4.0+), but insert and delete operations should always be mapped together.
Upvotes: 0
Reputation: 613
Here is a detailed step-by-step explanation of how to import a stored procedure into an entity. http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/12/17/ado-net-entity-framework-tools-stored-procedures.aspx
Upvotes: 1