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 6891291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:23:29+00:00 2026-05-27T06:23:29+00:00

I want to know how to send parameters to stored procedure from entity framework?

  • 0

I want to know how to send parameters to stored procedure from entity framework? Thanks in advance.

  • 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-27T06:23:29+00:00Added an answer on May 27, 2026 at 6:23 am

    First question is: for which version of the Entity Framework?? .NET 3.5? .NET 4 ?? Things have significantly changed (and improved!) in .NET 4.

    And secondly: what do you want to do:

    • retrieve rows from the database

    • execute a stored proc without return value

    • map INSERT/UPDATE/DELETE operations on an entity to a stored proc??

    These are three pretty different scenarios – so we need to know what you’re going for.

    Also: just search with Google (or Bing) – there are plenty of blog post and tutorials out there showing you how to do it – a quick list:

    • Entity Framework with .NET 3.5 and VS 2008 SP1
    • Using a Stored Procedure in Entity Framework 4
    • Call Stored Procedure from Entity Framework

    and literally thousands more ……

    Update: ok, so you want to retrieve data from the database. In that case, your steps are:

    • go to your EF model (*.edmx file) in the designer
    • right-click and select Update Model from Database
    • pick the stored procedure you want to use and go through the wizard

    enter image description here

    This creates an entry for the stored procedure in your physical storage model. Next:

    • go to the Model Browser (see the above context menu? It’s just below Update Model from Database), navigate to the Storage Model and find your procedure
    • right-click on that procedure

    enter image description here

    • Select Add Function Import which imports the “function” (stored procedure) from the physical storage model into the conceptual model (your entity context class, basically).

    enter image description here

    Here, you have four choices:

    • your stored proc might not return anything (like in my sample) – then it’s just a method on your context class that you can call that does something
    • your stored proc might return a collection of scalars, e.g. a list of INT values or something – pick the appropriate value in the dropdown
    • your stored proc might return entities from your model, e.g. complete Customer entities – in that case, select the last option and pick the entity you want to map to (your stored proc must return all columns for that entity, in this case)

    OR:

    • your stored proc returns something – but neither just scalars (not just INT), nor an entity – in that case, you can pick the third option and define a new complex type (a class) that will hold your results returned from the stored procedure.

    Whichever you do – basically EF will create a method on your object context class that you can call. Any parameters your stored proc requires will be parameters of that method so you can very easily pass in e.g. strings, ints etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to know how to edit a single row (which i select) from
I am trying to send parameters that I get from a table in my
I have an insert stored procedure which takes many parameters - 2 of them
I want to know the way by which I can send a SharedPreference file
I want to send a zip file through SOAP (from a SOAP client to
I think the title was clear enough. I want to know how to send
I want to know how can we send direct request to .DLL with some
Want to know what the stackoverflow community feels about the various free and non-free
want to know why String behaves like value type while using ==. String s1
I want to know what a virtual base class is and what it means.

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.