Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7168799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:51:17+00:00 2026-05-28T14:51:17+00:00

I have problem with entity framework and mysql. I have solved entity framework function

  • 0

I have problem with entity framework and mysql.
I have solved entity framework function parameters problem with this answer

But when I want to add some data with mysql stored procedure I have

Parameter ‘kick_Prod_StateID’ not found in the collection.

Error in C#.

My procedure like below:

CREATE  PROCEDURE CreateState_(

    IN kick_Prod_StateID INT(11),
    IN kick_ShortName VARCHAR(3),
    IN kick_StateName VARCHAR(50)
)

BEGIN INSERT INTO State_
(
    Prod_StateID_,
    ShortName_,
    StateName_
)
VALUES 
( 
    kick_Prod_StateID ,
    kick_ShortName ,
    kick_StateName
) ; 
END$$

and entity framework created C# code like below :

public ObjectResult<State_> AddState(Nullable<global::System.Int32> prod_StateID_, global::System.String shortName_, global::System.String stateName_)
    {
        ObjectParameter prod_StateID_Parameter;
        if (prod_StateID_.HasValue)
        {
            prod_StateID_Parameter = new ObjectParameter("Prod_StateID_", prod_StateID_);
        }
        else
        {
            prod_StateID_Parameter = new ObjectParameter("Prod_StateID_", typeof(global::System.Int32));
        }

        ObjectParameter shortName_Parameter;
        if (shortName_ != null)
        {
            shortName_Parameter = new ObjectParameter("ShortName_", shortName_);
        }
        else
        {
            shortName_Parameter = new ObjectParameter("ShortName_", typeof(global::System.String));
        }

        ObjectParameter stateName_Parameter;
        if (stateName_ != null)
        {
            stateName_Parameter = new ObjectParameter("StateName_", stateName_);
        }
        else
        {
            stateName_Parameter = new ObjectParameter("StateName_", typeof(global::System.String));
        }

        return base.ExecuteFunction<State_>("AddState", prod_StateID_Parameter, shortName_Parameter, stateName_Parameter);
    }

Error in this line ==>

return base.ExecuteFunction<State_>("AddState", prod_StateID_Parameter, shortName_Parameter, stateName_Parameter);

How can I solve this problem?

Thx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:51:18+00:00Added an answer on May 28, 2026 at 2:51 pm

    I solved the problem.

    The Problem was stored procedure parameters.

    When we use mysql and entity framework together, we should give same names to table and value parameters.

    I mean the stored procedure should be:

    CREATE  PROCEDURE CreateState_(
    
    IN Prod_StateID_ INT(11),
    IN ShortName_ VARCHAR(3),
    IN StateName_ VARCHAR(50)
    )
    
    BEGIN INSERT INTO State_
    (
    Prod_StateID_,
    ShortName_,
    StateName_
    )
    VALUES 
    ( 
    Prod_StateID_ ,
    ShortName_ ,
    StateName_
    ) ; 
    END$$
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using entity framework and i have a problem that this dropdown ignores my
I have this really strange problem where my entity framework query isn't enumerating correctly.
I'm using Entity Framework Code First. Usually I have no problem, but for a
I have a problem with the following Linq query using Entity Framework: from o
I'm using Entity Framework in my project, and I have the problem that, once
I have a problem adding ADO.Net Entity Data Model to my existing project, or
I have problem when I try insert some data to Informix TEXT column via
I have problem adding entity framework model to my project. Here is what I
I got a problem with Entity Framework 4.0 I have a hierarchical table Category:
I having a weird problem with Entity Framework with MySql database. Here's the code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.