Passing a parameter to a stored proc in entity framework that is not in the entity. RRS feed

  • Question

  • I am getting the following error message after I updated my entity model digram and included a sproc:

    Error 2037: A mapping function bindings specifies a function PhonebookModel.Store.usp_spm_phonebook_update but does not map the following function parameters: UserID.

    The beginning of my insert sproc is:

    CREATE PROCEDURE [dbo].[usp_spm_phonebook_insert]
     @FullName varchar(50),
     @ID varchar(10),
     @IsActive bit,
     @UserID uniqueidentifier  /*The user who created the record*/

    There is no UserID field in my phonebook table.  However, I want to pass it to the sproc because after I insert the data I am executing another statement that logs this insert to a change journal table.

    What do I need to do be able to pass the user ID to the sproc?


    - Bruce

    • Edited by BruceDB Tuesday, June 17, 2014 8:58 PM
    • Moved by Caillen Wednesday, June 18, 2014 8:45 AM
    Tuesday, June 17, 2014 8:50 PM


  • The parameter list (the 4 parameters in the code) of the Procedure are just input variables and don't need to be in any table.  Just add ID to the four existing variables.


    Tuesday, June 17, 2014 9:07 PM

All replies