Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Entity Framework - Stored procedures

Posted on 2008-10-14
Medium Priority
Last Modified: 2013-11-11
I want to use the entity framework to call a stored procedure. I created a function import using the designer in visual studio.  VmwEwonInterfaceEntities is the name of my model and SpCalaculateValues is the name of my sp, so i want to execute this code:

            using (VmwEwonInterfaceEntities entities = new VmwEwonInterfaceEntities())

The problem is that the stored procedure is not available on the model. Did i forgot something?

Urgent please, thanks in advance.
Question by:erwin_des
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 64

Expert Comment

by:Fernando Soto
ID: 22711223
Hi erwin_des;

When you added the class "Linq to SQL Classes" from the Add Item in the Solution Explorer and added the entity class did you drag the stored procedure from Server Explorer to the right panel of the entity designer?


Author Comment

ID: 22711957
I'm not using Linq to SQL Classes, i'm using a ADO.NEt Entity Data Model
LVL 64

Accepted Solution

Fernando Soto earned 1500 total points
ID: 22714694
Hi erwin_des;

I have not used this model but will look into this.

It seems that there are some extra stuff to deal with with Entity Data Model in adding a stored procedure. Below is an article showing how to implement a stored procedure with EDM. Look at the section marked "Stored Procedures in the Entity Model"
Stored Procedures in the Entity Model

I hope that this helps.

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

LVL 64

Expert Comment

by:Fernando Soto
ID: 22723422
Hi erwin_des;

Here is some more information on stored procedures in the Entity Framework.

Stored Procedure Support (Entity Framework)


Author Closing Comment

ID: 31505798
Thanks in probiding the links. It was usefull.

Expert Comment

by:Starr Duskk
ID: 22907597
Here is a video that uses ado.net entity and stored procedures:
LVL 64

Expert Comment

by:Fernando Soto
ID: 22908303

Expert Comment

ID: 25941839
Execute T-SQL Statements and stored using Entity framework 4

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question