<?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 : Stored procedure non-query calls</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Stored procedure non-query calls</description>
  <pubDate>Tue, 28 Apr 2026 21:41:17 -700</pubDate>
  <lastBuildDate>Fri, 25 Sep 2009 17:29:47 -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=1222</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>Stored procedure non-query calls : FunctionImports (and the DevForce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=5489#5489</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> 1222<br /><strong>Posted:</strong> 25-Sep-2009 at 5:29pm<br /><br />FunctionImports (and the DevForce StoredProcQuery)&nbsp;can only be used for queries, both by DevForce and by EF.&nbsp; What's happening is that the proc is&nbsp;executed, but then DevForce will throw&nbsp;when trying to process its "results".&nbsp; For the record, the PassthruEsqlQuery can also be used for queries only.<DIV>&nbsp;</DIV><DIV>EF (and DevForce) does support DeleteFunctions, but expects you to load up the entity and call .Delete() on it; the stored proc is then called instead of the usual delete command when SaveChanges is called.&nbsp; Probably not what you want, though, since it is slow to have to both load items and then individually delete them.&nbsp; Here's some info on stored proc support in EF - <a href="http://msdn.microsoft.com/en-us/library/bb399203.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/bb399203.aspx</A>.</DIV><DIV>&nbsp;</DIV><DIV>You can also define a cascading delete constraint, where a delete on the parent will automatically force deletion of the children, but again all items must already have been retrieved.</DIV><DIV>&nbsp;</DIV><DIV>Your best option might be to use either ADO.NET or EF Object Services to directly call the stored proc.&nbsp; If you want to run this only on the server you'll need to use InvokeServerMethod to call a custom method on the server.&nbsp; Your next issue is then ensuring that what's in the EntityManager cache&nbsp;now corresponds with the DB -- EM.RemoveEntities may help with this.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 25 Sep 2009 17:29:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=5489#5489</guid>
  </item> 
  <item>
   <title>Stored procedure non-query calls : I have also created a stored procedure...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=5481#5481</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=300" rel="nofollow">pucsoftware</a><br /><strong>Subject:</strong> 1222<br /><strong>Posted:</strong> 25-Sep-2009 at 10:49am<br /><br />I have also created a stored procedure to deleted the relationship record in a many-to-many scenario. I originally tried doing this using the navigation properties of the parent objects but the response was really slow. So, I opted to try the old Import Function feature of the Entity Framework. This appears to work however I'm getting an exception in the DomainModel that I can't seem to capture (and handle/ignore) so it crashes my application. The exception reads:<DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>"The data reader is incompatible with the specified &#091;devforce class&#093;. A member of the type, &#091;key field&#093;, does not have a corresponding column in the data reader with the same name."</DIV><DIV>&nbsp;</DIV><DIV>My code is using its class&nbsp;the signature of&nbsp;EntityManager.DefaultManager.MyDeleteMethod</DIV><DIV>&nbsp;</DIV><DIV>It appears that the record is being deleted outside of the persistence cache and throwing an error because all of sudden the record no longer exists. The record is being deleted from the database, though. Is there a proper way to go about this? Can you explain what I should do about this?</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 25 Sep 2009 10:49:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=5481#5481</guid>
  </item> 
  <item>
   <title>Stored procedure non-query calls : You could use Remote Service Method...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=4420#4420</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 1222<br /><strong>Posted:</strong> 17-Apr-2009 at 4:22pm<br /><br />You could use Remote Service Method Call (RSMC).&nbsp; Read about this in Chapter 12 of the Developer's Guide.<DIV>&nbsp;</DIV><DIV>The EntityManager has an InvokeServerMethod() method that facilitates the running of server-side-only methods. </DIV>]]>
   </description>
   <pubDate>Fri, 17 Apr 2009 16:22:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=4420#4420</guid>
  </item> 
  <item>
   <title>Stored procedure non-query calls : I was wondering if it is possible...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=4417#4417</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=326" rel="nofollow">kmg-pm</a><br /><strong>Subject:</strong> 1222<br /><strong>Posted:</strong> 17-Apr-2009 at 1:43pm<br /><br />I was wondering if it is possible in DevForceEF to call a stored procedure that is a non-query?<DIV>&nbsp;</DIV><DIV>My stored proc does not return any data mapped to objects.&nbsp; I was trying to figure out the how (and if) the&nbsp;"StoredProcRdbQuery" or "PassthruRdbQuery" classes worked in EF, but could find no documentation other than a brief mention in the Developers Guide.</DIV><DIV>&nbsp;</DIV><DIV>Of course I could do this through a straight SQL/ADO mechanism, but I wanted to try and keep all of my DB interfacing through DevForceEF.</DIV><DIV>&nbsp;</DIV><DIV>Any help would be greatly appreciated!</DIV><DIV>&nbsp;</DIV><DIV>Thanks,</DIV><DIV>Kevin</DIV>]]>
   </description>
   <pubDate>Fri, 17 Apr 2009 13:43:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1222&amp;PID=4417#4417</guid>
  </item> 
 </channel>
</rss>