2
create procedure GetCityArea
as
begin
    select * from CityMaster;
    select * from Area;
End

This is my stored procedure GetCityArea which returns multiple record.

My exact problem is I am getting multiple record from the stored procedure, and I want to show this result in single view as separate tables. I am new in ASP.NET MVC and I want to solve this problem using Entity Framework. Please help.

1 Answer 1

2

You can do this using ObjectContext and the Translate method.

The gory details are here: https://msdn.microsoft.com/en-us/data/jj691402.aspx

Sign up to request clarification or add additional context in comments.

5 Comments

Very interesting - thank you, Erik, for pointing that out! Doesn't look very "polished" and EF like - but at least it can be done.
No, that is why I used the word "gory"
Hey Erik could you help me little more.In this stored procedure only two select statement is there what if it contains more than two statement.
Hey Erik actually my problem is I have stored procedure which contains 7 to 8 select statement but I want to fetch only 5 result set from different table .this means in my controller i want to set limit to record set which is coming from stored procedure and another problem is in above stored procedure i know i am getting city records and area records so to display this record i have created two different list.what if i don't know what record set I am getting then how to display this different record set to my view.
You need to change your stored procedure to be predictable!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.