MVC - Select from Stored Procedure in Entity Framework

asp.net-mvc entity-framework-6 stored-procedures

Question

I am new to ASP.NET MVC. I should create a page where users enters an order for their shops by central warehouse. The products and amounts are listed by a stored procedure from database. I have to show rows in a gridview which are calculated by the stored procedure. I want to insert the changed data in a table in SQL after the user make changes on the gridview. Users can call the saved doc back and make changes on it and save it again.

I can't build a strategy how that can be made. If I use Entity Framework I can show the SQL table rows in grid but it is not my goal. I have to let the SQL calculate first the data. Could you please give me some start point and steps to go ahead. I hope I could explain what I need.

1
1
1/13/2016 9:06:50 AM

Popular Answer

There Are some simple steps to do that

1- Go and update model from database and add the required Stored procedureenter image description here

2- create a complex type from model browser

enter image description here

in complex type map your Stored procedure fields as it returns the data.

3- and map that complex type to the stored procedure. and use it as you use table.

0
1/13/2016 9:24:57 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow