0

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.

  1. I had added the sp
  2. i had imported the functions in the model browser.
  3. 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.

2
  • 3
    Yes, if you map one type of operation (Insert for example), you must map all three. However, can you clarify what you mean by getting the name of the SP in the connection string?
    – DCNYAM
    Apr 30, 2010 at 13:28
  • connection string used to keep connecting to database informatio
    – DeveloperX
    May 31, 2011 at 14:45

2 Answers 2

1

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

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.