Link to home
Start Free TrialLog in
Avatar of erwin_des
erwin_des

asked on

Entity Framework - Stored procedures

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())
            {
                 entities.SpCalculateValues()
            }

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

Urgent please, thanks in advance.
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

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?

Fernando
Avatar of erwin_des
erwin_des

ASKER

I'm not using Linq to SQL Classes, i'm using a ADO.NEt Entity Data Model
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi erwin_des;

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

Stored Procedure Support (Entity Framework)
http://msdn.microsoft.com/en-us/library/bb399203.aspx

Fernando
Thanks in probiding the links. It was usefull.
Here is a video that uses ado.net entity and stored procedures:
 
http://www.asp.net/learn/3.5-SP1/video-245.aspx
 
 
Thanks.
Execute T-SQL Statements and stored using Entity framework 4
http://ledomoon.blogspot.com/2009/12/execute-t-sql-statements-and-stored.html