ASP.Net MVC controller code to get data from stored procedure

Reaper

New Member
Here is what I have:
  • A stored procedure (\[code\]sp_GetSpeeds\[/code\]) inside a SQL Server database
  • ADO.NET Data Entity Model for that stored procedure
  • Imported Function for stored procedure with complex types created
  • Website written in ASP.net MVC
Here is what I need:Inside the controller, there needs to be code to call and get the data from stored procedure. My code is not working. Can you please debug it? (i'm very new to this).\[code\] [OutputCache(NoStore = true, Location = OutputCacheLocation.Client, Duration = 1)] public ActionResult _Speeds() { aaReportsEntities dataContext = new aaReportsEntities(); return this.PartialView(dataContext.sp_GetSpeeds().First<sp_GetSpeeds_Result>()); }\[/code\]
 
Back
Top