<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Using Stored Proc in MVVM Light example</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Using Stored Proc in MVVM Light example</description>
  <pubDate>Tue, 12 May 2026 21:29:56 -700</pubDate>
  <lastBuildDate>Sun, 28 Apr 2013 20:15:53 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=4127</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Using Stored Proc in MVVM Light example : Yep that got it. Thanks </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4127&amp;PID=16268#16268</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1303" rel="nofollow">Delta_Rich</a><br /><strong>Subject:</strong> 4127<br /><strong>Posted:</strong> 28-Apr-2013 at 8:15pm<br /><br />Yep that got it.<br />Thanks]]>
   </description>
   <pubDate>Sun, 28 Apr 2013 20:15:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4127&amp;PID=16268#16268</guid>
  </item> 
  <item>
   <title>Using Stored Proc in MVVM Light example : A StoredProcQuery when executed...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4127&amp;PID=16267#16267</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 4127<br /><strong>Posted:</strong> 26-Apr-2013 at 10:42am<br /><br />A StoredProcQuery when executed returns an IEnumerable, so if you cast the op.Results to an IEnumerable&lt;Customer&gt; this should work:<br /><br /><table width="99%"><tr><td><pre class="BBcode">success(op.Results.Cast&lt;Customer&gt;());</pre></td></tr></table><br />You'll need a using statement for System.Linq too.<br />]]>
   </description>
   <pubDate>Fri, 26 Apr 2013 10:42:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4127&amp;PID=16267#16267</guid>
  </item> 
  <item>
   <title>Using Stored Proc in MVVM Light example : I have watched and followed the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4127&amp;PID=16260#16260</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1303" rel="nofollow">Delta_Rich</a><br /><strong>Subject:</strong> 4127<br /><strong>Posted:</strong> 25-Apr-2013 at 4:24pm<br /><br />I have watched and followed the video "<strong>MVVM Light with DevForce (Silverlight)</strong>", which was a great help. Now I am stuck with how to utilise the "Function Import" of a stored procedure returning a list of Entities.<br /><br />If for example (from the example above) I create a Stored Proc that retrieves Customers where Country = parameter 1 and Region = parameter 2<br />(obviously this could be done using Linq but I want to show this as an example of parametised sprocs).<br />eg SQL would "<font color=blue>EXECUTE usp_CustomerCtyReg 'USA', 'OR'</font>"<br /><br />In my dataservice I would try it this way - varying from the video example by calling the LoadCustomersViaSPQuery:<br /><br /><font color=blue>public void LoadCustomersViaSPQuery( Action&lt;IEnumerable&lt;Customer&gt;&gt; success = null, Action&lt;Exception&gt; fail = null)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Call the StoredProc for this <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Manager.RetrieveSPCustomersQuery(pCountry: "USA", pRegion: "OR")<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;op.MarkErrorAsHandled();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fail(op.Error);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br />}</font><br /><br /><br />However, the <font color=red>success(op.Results)</font> is erroring - "Delegate .... has some missing arguments."<br /><br />Once I sought that out I imagine (and probably incorrectly) the ViewModel should just follow the remainder of the example.<br /><br />Anyhow, can someone <strong>please</strong> provide me with the "how to" based on the video example?]]>
   </description>
   <pubDate>Thu, 25 Apr 2013 16:24:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4127&amp;PID=16260#16260</guid>
  </item> 
 </channel>
</rss>