I see two solutions: one is ugly, but this is probably what you are looking for. In your controller, you can use your procedure to receive data, and then pass it to the view using the ViewData collection, fe:
public ActionResult Details(int id) { var intData = SPGetInt(id); var stringData = SPGetString(id); ViewData["intData"] = intData; ViewData["stringData"] = stringData; return View(); }
and then use it like:
<%=ViewData["intData"] %>
The best solution is to create at least a ViewModel just to save the information needed for display. You can rewrite all the data that you get from the database into this model. Then you get a very important feature that is strongly typed.
source share