Call Stored Procedure Using Entity Framework In Visual Studio

For More Videos Visit Our YouTube Channel

First of all add Entity Framework to your solution as shown in the link.

How To Add Entity Framework In Visual Studio

For Calling Stored Procedure using Entity Framework follow the below code.

Call Stored Procedure Using Entity Framework In Visual Studio, Stored Procedure Using Entity Framework, Invoke Stored Procedure Using Entity Framework, using Entity Framework Stored Procedure, Entity Framework, Asp.Net, WCF, MVC, Asp.Net MVC
Here TechnomarkEntities is the instance of Entity Model. Using enclosure do the automatic Connection Open and Close. Its always better to accept the result of an Stored Procedure in var result Now Entity Instance.Name of SP will give the result as shown below

var result = obj.GetdatFromSp();

If the SP have parameters, then specify them after the opening bracket.

var result = obj.GetdatFromSp("Name");

By this way we can call Stored Procedure using Entity Framework.