<?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 : how to do serverside logic using a stored proc.</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : how to do serverside logic using a stored proc.</description>
  <pubDate>Sat, 18 May 2013 14:53:53 -700</pubDate>
  <lastBuildDate>Fri, 29 Jun 2007 09:07:00 -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=99</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>how to do serverside logic using a stored proc. : Thanks you for a quick reply :-)  Dominique...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=99&amp;PID=219#219</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 99<br /><strong>Posted:</strong> 29-Jun-2007 at 9:07am<br /><br />Thanks you for a quick reply :-)<br /><br />Dominique]]>
   </description>
   <pubDate>Fri, 29 Jun 2007 09:07:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=99&amp;PID=219#219</guid>
  </item> 
  <item>
   <title>how to do serverside logic using a stored proc. : Dominique,  This seems like...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=99&amp;PID=217#217</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> 99<br /><strong>Posted:</strong> 29-Jun-2007 at 8:55am<br /><br />Dominique,<DIV>&nbsp;</DIV><DIV>This seems like an ideal opportunity to use RPC.&nbsp; RPC allows you to have any type of return object (e.g., void, string, array), not just a list of Business Objects.</DIV><DIV>&nbsp;</DIV><DIV>You can find this information (I agree it's sparse and hard to find) in Reference Help under <strong><FONT size=3>ServerRpcDelegate Delegate<!--DX end--> </FONT></strong></DIV><DIV><strong><FONT size=4></FONT></strong>&nbsp;</DIV><DIV>Here is an email example:</DIV><DIV>&nbsp;</DIV><DIV><TABLE =syntaxtable cellSpacing=0 cellPadding=0 width="100%"><T><TR><TH>C#</TH><TH><SPAN =copyCode =CopyCode_CheckKey(this) =changeCopyCodeIc&#111;n(this,true) out=changeCopyCodeIc&#111;n(this,false) =copyCode(this) in=changeCopyCodeIc&#111;n(this,true) =0 =changeCopyCodeIc&#111;n(this,false)></SPAN></TH></TR><TR><TD colSpan=2><CODE =CS>//&nbsp;Sample&nbsp;showing&nbsp;invocation&nbsp;of&nbsp;server&nbsp;method&nbsp;<BR>PersistenceManager&nbsp;pm&nbsp;=&nbsp;PersistenceManager.DefaultManager;&nbsp;<BR>int&nbsp;orderId&nbsp;=&nbsp;10250;&nbsp;<BR>bool&nbsp;mailSent&nbsp;=&nbsp;(bool)&nbsp;pm.InvokeServerMethod(Order.EmailOrderInfo,&nbsp;orderId);&nbsp;<BR>&nbsp;<BR>//&nbsp;sample&nbsp;method&nbsp;defined&nbsp;in&nbsp;Order&nbsp;class&nbsp;<BR>public&nbsp;class&nbsp;Order&nbsp;:&nbsp;OrderDataRow&nbsp;{&nbsp;<BR>//...&nbsp;<BR>&nbsp;&nbsp;//&nbsp;ServerRpcDelegate&nbsp;method,&nbsp;called&nbsp;from&nbsp;client&nbsp;<BR>&nbsp;&nbsp;&#091;AllowRpc&#093;&nbsp;<BR>&nbsp;&nbsp;public&nbsp;static&nbsp;Object&nbsp;EmailOrderInfo(IPrincipal&nbsp;pPrincipal,&nbsp;DataSourceResolver&nbsp;pResolver,&nbsp;params&nbsp;Object&#091;&#093;&nbsp;pArgs)&nbsp;{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;orderId&nbsp;=&nbsp;Convert.ToInt32(pArgs&#091;0&#093;);&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;build&nbsp;and&nbsp;send&nbsp;an&nbsp;email&nbsp;message&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;from&nbsp;=&nbsp;"sales@mycompany.com";&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;to&nbsp;=&nbsp;"customer@yourcompany.com";&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.Net.Mail.MailMessage&nbsp;msg&nbsp;=&nbsp;new&nbsp;System.Net.Mail.MailMessage(from,&nbsp;to);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.Subject&nbsp;=&nbsp;"Order&nbsp;Information";&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;msg.Body&nbsp;=&nbsp;string.Format("Order&nbsp;id&nbsp;=&nbsp;{0}&nbsp;has&nbsp;been&nbsp;shipped",&nbsp;orderId);&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.Net.Mail.SmtpClient&nbsp;mailClient&nbsp;=&nbsp;new&nbsp;System.Net.Mail.SmtpClient("localhost");&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mailClient.Send(msg);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(Exception&nbsp;e)&nbsp;{&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TraceFns.WriteLine(e.Message);&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;false;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;true;&nbsp;<BR>&nbsp;}&nbsp;<BR>}</CODE></TD></TR></T></TABLE></DIV>]]>
   </description>
   <pubDate>Fri, 29 Jun 2007 08:55:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=99&amp;PID=217#217</guid>
  </item> 
  <item>
   <title>how to do serverside logic using a stored proc. : Hi,  From my client applications(smart...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=99&amp;PID=216#216</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=60" rel="nofollow">Dominique</a><br /><strong>Subject:</strong> 99<br /><strong>Posted:</strong> 29-Jun-2007 at 8:14am<br /><br />Hi,<br /><br />From my client applications(smart client) I need to fetch serienumbers from a serie hold in a database table.<br />I use a stored procedure to pull out the right number and do the updates to the series. I want to have extra logic on the server like sending an email to our support if the remaining numbers goes under a limit.<br /><br />Ideally I would like to call from my client a function like: <br /><font face="Courier New, Courier, mono">GetserieNumber (serieType, quantity) as ResponseObject</font><br /> ResponseObject being a structure with for example<br />.serietype<br />.quantity_asked as int32<br />.firstSerieNumber as Integer?<br />.IsOk as boolean<br />.message as string <br /><br />the minimum would be to get back an integer or "nothing" (dbnull or vb nothing)<br />I could build a webservice or use remoting but when using a BOS it looks like I could let the BOS do the  remoting part of the job maybe with RPC.<br />Is it possible to have the BOS calling such a function (in-process?)? or do you have any proposition of how to do that when using Devforce?<br />btw, I didn't find examples with the RPC stuff, could you give me a pointer to it? (page in the dev. manual or weblink)<br /><br />Dominique<br /><br /><span style="font-size:10px"><br /><br />Edited by Dominique - 29-Jun-2007 at 8:15am</span>]]>
   </description>
   <pubDate>Fri, 29 Jun 2007 08:14:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=99&amp;PID=216#216</guid>
  </item> 
 </channel>
</rss>