<?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 : ParameterizedSql in PassthruRdbQuery</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : ParameterizedSql in PassthruRdbQuery</description>
  <pubDate>Thu, 11 Jun 2026 01:37:24 -700</pubDate>
  <lastBuildDate>Tue, 24 Jun 2008 15:51:30 -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=394</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>ParameterizedSql in PassthruRdbQuery : Nevermind, I figured it out. ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=3119#3119</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=34" rel="nofollow">jeffdoolittle</a><br /><strong>Subject:</strong> 394<br /><strong>Posted:</strong> 24-Jun-2008 at 3:51pm<br /><br />Nevermind, I figured it out.<br>]]>
   </description>
   <pubDate>Tue, 24 Jun 2008 15:51:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=3119#3119</guid>
  </item> 
  <item>
   <title>ParameterizedSql in PassthruRdbQuery : Kim,I&amp;#039;m trying to follow...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=3118#3118</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=34" rel="nofollow">jeffdoolittle</a><br /><strong>Subject:</strong> 394<br /><strong>Posted:</strong> 24-Jun-2008 at 3:38pm<br /><br />Kim,<br><br>I'm trying to follow the example above in order to create a parameterized query, but I get a persistence server exception.<br><br>When I call this method:<br><br><div><font color="#0000ff" size="2">string</font><font size="2"> parmName = key.AdoHelper.FormatParameterName(</font><font color="#800000" size="2">"pc"</font><font size="2">);</font></div><br>it doesn't seem to do anything to the parameter name.&nbsp; When I inspect the parameterized sql, I see a clause that says "PostalCode=pc" but apparent the the variable "pc" isn't being replaced properly with the parameter value when the query is executed.<br><br>The exception detail follows:<br><br>IdeaBlade.Persistence.PersistenceServerException : Invalid column name 'pc'.<br>&nbsp; ----&gt; System.Data.OleDb.OleDbException : Invalid column name 'pc'.<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.HandlePersistenceServerException(Exception pException, Boolean pTryToHandle, PersistenceOperation pOperation)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.XFetchDataSet(IEntityQuery pEntityQuery)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.XFetch(IEntityFinder pEntityFinder, WorkState pWorkState)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.XFetch(IEntityQuery pEntityQuery, QueryStrategy pQueryStrategy, WorkState pWorkState)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.XGetEntities(IEntityQuery pEntityQuery, QueryStrategy pQueryStrategy, WorkState pWorkState)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.GetEntities&#091;T&#093;(IEntityQuery pEntityQuery, QueryStrategy pQueryStrategy)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.GetEntities&#091;T&#093;(IEntityQuery pEntityQuery)<br>&nbsp;&nbsp;&nbsp; C:\Projects\Lotpath\Source\Lotpath.Model\Search\SearchHelper.cs(37,0): at Lotpath.Model.SearchHelper.GetSearchResult()<br>&nbsp;&nbsp;&nbsp; C:\Projects\Lotpath\Source\Lotpath.Model\Search\SearchHelper.cs(24,0): at Lotpath.Model.SearchHelper.GetResult(SearchFilter searchFilter)<br>&nbsp;&nbsp;&nbsp; C:\Projects\Lotpath\Tests\Lotpath.Model.Tests\SearchHelperTest.cs(125,0): at Lotpath.Model.Tests.SearchHelperTest.GS1AttributeFilteredSearchWithLocationFilterTest()<br><br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.RemotingPersistenceServerProxy.CheckConnection(Exception pException)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceServerProxy.Fetch(SessionBundle pBundle, IEntityQuery pQuery)<br>&nbsp;&nbsp;&nbsp; IdeaBlade.Persistence.PersistenceManager.XFetchDataSet(IEntityQuery pEntityQuery)<br>]]>
   </description>
   <pubDate>Tue, 24 Jun 2008 15:38:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=3118#3118</guid>
  </item> 
  <item>
   <title>ParameterizedSql in PassthruRdbQuery : I think the Passthru query is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1031#1031</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> 394<br /><strong>Posted:</strong> 29-Aug-2007 at 3:45pm<br /><br />I think the Passthru query is the IdeaBlade way of doing what you want here.&nbsp; The only other alternative would be to write a wrapper stored proc, and then use a StoredProcRdbQuery.&nbsp; I don't really know what the benefits vs. drawbacks would be for the different approaches, but it really comes down to a matter of choice and which you find fits in best with your application.]]>
   </description>
   <pubDate>Wed, 29 Aug 2007 15:45:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1031#1031</guid>
  </item> 
  <item>
   <title>ParameterizedSql in PassthruRdbQuery :  zahidAccording to the documentation...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1030#1030</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=131" rel="nofollow">-ook</a><br /><strong>Subject:</strong> 394<br /><strong>Posted:</strong> 29-Aug-2007 at 2:42pm<br /><br />zahid<br><br>According to the documentation the PassThruQuery can be just as efficient as an Entity Query depending on the way you have written the statement. There are disadvantages in disconnected applications. Thanks for the string append method, but I did need the parameters due to SQL Server formatting my datetime variable to the US date format instead of Aussie.<br><br>Kimj<br><br>Thanks for the example, my parameters are not keys but dates (that I am using in a SQL user defined function in order to keep the same logic between SQL Server Reports and this IdeaBlade application).&nbsp; However you have given me the correct syntax and advice I need to make it work, again thanks.<br><br>Hmmmm ... but maybe there is an IdeaBlade way of doing what I want. Perhaps it should be in a different thread. Below is the SQL Code I'm using in Reporting Services for my reports. I want the same statement in IdeaBlade without having to redo the UDF as a class (because then I have to maintain two different sets of code that do the same thing). Possible or is a Passthru the only option?<br><br>SELECT *<br>FROM vwPallets<br>WHERE DateTimeStacked between dbo.fnShiftStart(@StartDate,@StartType) AND dbo.fnShiftEnd(@EndDate,@EndType)<br><br>The SQL UDF's work out the correct date and times that should be included for a shift range.<br><br>Thanks<br><br><span style="font-size:10px"><br /><br />Edited by -ook - 29-Aug-2007 at 2:42pm</span>]]>
   </description>
   <pubDate>Wed, 29 Aug 2007 14:42:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1030#1030</guid>
  </item> 
  <item>
   <title>ParameterizedSql in PassthruRdbQuery : Here&amp;#039;s one example of how...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1025#1025</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> 394<br /><strong>Posted:</strong> 29-Aug-2007 at 10:22am<br /><br />Here's one example of how you can pass parameterized SQL through the PassthruRdbQuery:<DIV><FONT color=#008000 size=2><FONT color=#008000 size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#008000 size=2><FONT color=#008000 size=2>// We're retrieving the RdbKey here so that the parameter name can be </FONT></FONT></DIV><DIV><FONT color=#008000 size=2><FONT color=#008000 size=2>//formatted correctly. If you already know your data provider and </FONT></FONT></DIV><DIV><FONT color=#008000 size=2><FONT color=#008000 size=2>//parameter format you can skip this step and hardcode the parameter name.</FONT></FONT></DIV><DIV><FONT color=#008000 size=2><FONT color=#008000 size=2>&nbsp;</DIV></FONT></FONT><DIV><FONT color=#008080 size=2>RdbKey</FONT><FONT size=2> key = (</FONT><FONT color=#008080 size=2>RdbKey</FONT><FONT size=2>) </FONT><FONT color=#0000ff size=2>PM</FONT><FONT size=2>.GetDataSourceKey(</FONT><FONT color=#0000ff size=2>typeof</FONT><FONT size=2>(</FONT><FONT color=#008080 size=2>Employee</FONT><FONT size=2>));</FONT></DIV><DIV><FONT color=#0000ff size=2>string</FONT><FONT size=2> parmName = key.AdoHelper.FormatParameterName(</FONT><FONT color=#800000 size=2>"id"</FONT><FONT size=2>);</FONT></DIV><DIV><FONT size=2><FONT color=#008000 size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2><FONT color=#008000 size=2>// Build select statement</DIV></FONT></FONT><DIV><FONT color=#0000ff size=2>string</FONT><FONT size=2> passThruSelect = </FONT><FONT color=#0000ff size=2>string</FONT><FONT size=2>.Format(</FONT><FONT color=#800000 size=2>"select * from Employee where id = {0}"</FONT><FONT size=2>, parmName);</FONT></DIV><DIV><FONT size=2><FONT color=#008000 size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2><FONT color=#008000 size=2>// Build the parameters - be sure to use RdbParameter (esp. if using a BOS)</DIV></FONT></FONT><DIV><FONT color=#008080 size=2>RdbParameter</FONT><FONT size=2> parm = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>RdbParameter</FONT><FONT size=2>(parmName, </FONT><FONT color=#008080 size=2>DbType</FONT><FONT size=2>.Int32);</FONT></DIV><DIV><FONT size=2>parm.Value = 1;</FONT></DIV><DIV><FONT size=2><FONT color=#008000 size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2><FONT color=#008000 size=2>// Now create a ParameterizedSql instance</DIV></FONT></FONT><DIV><FONT color=#008080 size=2>ParameterizedSql</FONT><FONT size=2> sql = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>ParameterizedSql</FONT><FONT size=2>(passThruSelect, parm);</FONT></DIV><DIV><FONT size=2><FONT color=#008000 size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2><FONT color=#008000 size=2>// And finally setup the passthru query and execute it</DIV></FONT></FONT><DIV><FONT color=#008080 size=2>PassthruRdbQuery</FONT><FONT size=2> passThruQuery = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>PassthruRdbQuery</FONT><FONT size=2>(</FONT><FONT color=#0000ff size=2>typeof</FONT><FONT size=2>(</FONT><FONT color=#008080 size=2>Employee</FONT><FONT size=2>), sql);</FONT></DIV><DIV><FONT color=#008080 size=2>Employee</FONT><FONT size=2> emp = </FONT><FONT color=#0000ff size=2>PM</FONT><FONT size=2>.GetEntity&lt;</FONT><FONT color=#008080 size=2>Employee</FONT><FONT size=2>&gt;(passThruQuery);</DIV></FONT>]]>
   </description>
   <pubDate>Wed, 29 Aug 2007 10:22:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1025#1025</guid>
  </item> 
  <item>
   <title>ParameterizedSql in PassthruRdbQuery : I am not sure about the performance...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1016#1016</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=123" rel="nofollow">owais,zahid</a><br /><strong>Subject:</strong> 394<br /><strong>Posted:</strong> 29-Aug-2007 at 5:53am<br /><br />I am not sure about the performance penalty of PassthruRdbQuery, but&nbsp;i have used in like <DIV>&nbsp;</DIV><DIV>PassthruRdbQuery aQuery = new PassthruRdbQuery(typeof(Payment),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "select * from dbo.APPayment as vp where " +<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "vp.IsUnposted = 'False' and vp.VendorId = '" + pvendorId.ToString() + "' and vp.PacketId IN (select Id from dbo.APPacket as ap where " +<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ap.IsPosted = 'True')");</DIV><DIV>&nbsp;</DIV><DIV>Hope this works for u. </DIV><DIV>&nbsp;</DIV><DIV>-&gt; Can any one tell me about the performance issues with it?</DIV>]]>
   </description>
   <pubDate>Wed, 29 Aug 2007 05:53:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1016#1016</guid>
  </item> 
  <item>
   <title>ParameterizedSql in PassthruRdbQuery : HelloI want to create a simple...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1015#1015</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=131" rel="nofollow">-ook</a><br /><strong>Subject:</strong> 394<br /><strong>Posted:</strong> 29-Aug-2007 at 12:23am<br /><br />Hello<br><br>I want to create a simple PassthruRdbQuery that contains a few parameters (yes,yes I know DevForce don't necessarily advocate the use of this - but too bad I'm using it!). I want to include some parameters within the SQL Statement. However the supplied documentation and tutorials neglect to show how the ParameterizedSql is created - one simple example in the Help system would have been enough for me.<br><br>So, can someone please provide me with an example of a Passthru query with parameters?<br><br>Thanks<br>]]>
   </description>
   <pubDate>Wed, 29 Aug 2007 00:23:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=394&amp;PID=1015#1015</guid>
  </item> 
 </channel>
</rss>