<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET MVC</title><link>http://forums.asp.net/1146.aspx</link><description>Discussions regarding Model-View-Controller (MVC) support in ASP.NET.  &lt;a href="http://forums.asp.net/1215.aspx"&gt;T4MVC subforum&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: How do I output ISingleResult from storeprocedure to view ?</title><link>http://forums.asp.net/thread/3274033.aspx</link><pubDate>Fri, 03 Jul 2009 21:51:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274033</guid><dc:creator>CodeHobo</dc:creator><author>CodeHobo</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274033.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=3274033</wfw:commentRss><description>&lt;p&gt;Is it a strongly typed view? If so what is the type defined? At the top of your view you should have something like this&lt;/p&gt;&lt;p&gt;Inherits=&amp;quot;System.Web.Mvc.ViewPage&amp;lt;&lt;span&gt;ISingleResult&amp;lt;spGetResult&amp;gt;&lt;/span&gt;&amp;gt;&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;span&gt;If you don&amp;#39;t want to use a strongly typed view you can still send the object to the View using the ViewData dictionary like so&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;ViewData[&amp;quot;result&amp;quot;]=&lt;/span&gt;&lt;span&gt;r;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Then in the View you can extract that data like so&lt;/p&gt;&lt;p&gt;var result = &lt;span&gt;ViewData[&amp;quot;result&amp;quot;] as &lt;/span&gt;&lt;span&gt;ISingleResult&amp;lt;spGetResult&amp;gt;;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How do I output ISingleResult from storeprocedure to view ?</title><link>http://forums.asp.net/thread/3273507.aspx</link><pubDate>Fri, 03 Jul 2009 12:32:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273507</guid><dc:creator>Reflector</dc:creator><author>Reflector</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273507.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1146&amp;PostID=3273507</wfw:commentRss><description>&lt;p&gt;&lt;pre name="code" class="c-sharp:collapse:showcolumns"&gt;&lt;pre name="code" class="c-sharp:nogutter:collapse:nocontrols:showcolumns"&gt;private storeprocDataContext sp = new storeprocDataContext();

public ActionResult Index()
{
	ISingleResult&amp;lt;spGetResult&amp;gt; r = sp.spGet();
	return View(r.ToList()); 
}&lt;/pre&gt;&lt;br /&gt;The above will throw an Error as &amp;quot;ISingleResult&amp;quot; cant be outputed to view so what do I do ? &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/p&gt;</description></item></channel></rss>