views:

36

answers:

2

Hello,

I have an application with an Entity Data Model. I do not completely understand the value of an Entity Data Model. Either way, I know that it connects to my database and interacts with it. I have some C# code from which I want to execute a stored procedure. My problem is, I'm not sure how to do this using the "Entity Data Model" approach.

I'm familiar with the System.Data.SqlClient namespace, but that approach does not seem applicable here. Can someone tell me how to interact with an Entity Data Model sproc via code?

Thanks!

+1  A: 

This MSDN page explains how to work with stored procedures with the entity framework: http://msdn.microsoft.com/en-us/library/bb896279.aspx.

Pieter
+1  A: 

Here's a great video tutorial on "Practical Entity Framework for C#"

You can call a stored procedure on SQL Server like this:

myEntities.CalculateCustomerInvoices();

Here's an article on "Using Stored Procedures for Insert, Update & Delete in an Entity Data Model"

p.campbell