<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/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>SQL Database Integration</title><link>https://www.infopathdev.com:443/forums/47.aspx</link><description>For questions concerning issues in the integration of SQL and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Parameter to a multi-table secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/53158.aspx</link><pubDate>Fri, 26 Mar 2010 18:05:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53158</guid><dc:creator>Fletchsm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53158.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=53158</wfw:commentRss><description>&lt;p&gt;Well not sure if this was the best way to do it, but it worked. I am sure if anyone had any C# training at all they would have known this right off the bat :) since you have to put a + after each new line and each line has to be inclosed in &amp;quot; for the statement&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;shape {select * from InspectionReports where IRid = &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; + IRlookup + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot; } as InspectionReports &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; +&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;append ({select * from IRHealthSafetyActions as IRHealthSafetyActions} relate IRid TO IRid) as IRHealthSafetyActions, &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;+&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot; ({select * from IREnergyMeasureActions as IREnergyMeasureActions} relate IRid TO IRid) as IREnergyMeasureActions,&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;+&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot; ({select * from IRDiagnosticTestsActions as IRDiagnosticTestsActions}relate IRid TO IRid) as IRDiagnosticTestsActions,&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;+&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot; ({select * from IRComments as IRComments} relate IRid TO IRid) as IRComments&amp;quot;&amp;nbsp;;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Parameter to a multi-table secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/53122.aspx</link><pubDate>Fri, 26 Mar 2010 03:11:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53122</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53122.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=53122</wfw:commentRss><description>&lt;p&gt;Hi FletchSm,&lt;/p&gt;
&lt;p&gt;Thanks for posting!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First off, your question is more of a SQL coding question, not really InfoPath. Second, writing code in your form is not a best practice because it increases IT cost to maintain across multiple XSNs. Now, I know you&amp;#39;re a developer and those two points mean absolutely nothing to you. You just want a solution and I can appreciate that, but we&amp;#39;ve got to pay for this free forum somehow, so we hope people take a look at our ultra-cheap &lt;a title="qWSSP" href="http://www.qdabra.com/en/products/WSSP.aspx"&gt;qWSSP Web Service&lt;/a&gt; which basically does what you want to do without writing code. Not only is it dirt cheap but it also reduces the cost of code maintenance - since it&amp;#39;s codeless, so you win double (well, your company wins double - maybe you don&amp;#39;t win because you can&amp;#39;t write code like you want ... :)&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t work for you, please wait for someone else to offer you free assistance. Unfortunately, we can&amp;#39;t fund free coding help for people due to the above. Hope you understand. &lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Patrick&lt;/p&gt;</description></item><item><title>Parameter to a multi-table secondary data source</title><link>https://www.infopathdev.com:443/forums/thread/53103.aspx</link><pubDate>Thu, 25 Mar 2010 14:47:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53103</guid><dc:creator>Fletchsm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53103.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=53103</wfw:commentRss><description>&lt;p&gt;I am trying to see how to format the SQL statement for a button that will query based on another field in my form. I know how to write sql queries normally but the c# is throwing me off. If anyone has any links to examples or tutorials that would be helpful. Thanks.&lt;/p&gt;
&lt;p&gt;Here is what Infopath says the sql is on my secondary datasouce I am using when I modify/edit the datasource.&lt;/p&gt;
&lt;p&gt;shape&lt;br /&gt;&amp;nbsp;{select &amp;quot;IRid&amp;quot;,&amp;quot;MonVisitnumber&amp;quot;,&amp;quot;MonitorID&amp;quot;,&amp;quot;UnitStatusID&amp;quot;,&amp;quot;GranteeAgencyCD&amp;quot;,&amp;quot;DateOfVisit&amp;quot;,&amp;quot;OccupantName&amp;quot;,&amp;quot;JobNo&amp;quot;,&amp;quot;HeatingCon&amp;quot;,&amp;quot;InsulationCon&amp;quot;,&amp;quot;AddFundSour&amp;quot;,&amp;quot;Passed&amp;quot; from &amp;quot;smorris&amp;quot;.&amp;quot;InspectionReports&amp;quot; as &amp;quot;InspectionReports&amp;quot;} as &amp;quot;InspectionReports&amp;quot;&lt;br /&gt;&amp;nbsp;append&lt;br /&gt;&amp;nbsp;&amp;nbsp;({select &amp;quot;IRid&amp;quot;,&amp;quot;LineItemID&amp;quot;,&amp;quot;ActiontypeID&amp;quot;,&amp;quot;ActionCOM&amp;quot;,&amp;quot;ActionHS&amp;quot; from &amp;quot;smorris&amp;quot;.&amp;quot;IRHealthSafetyActions&amp;quot; as &amp;quot;IRHealthSafetyActions&amp;quot;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;relate &amp;quot;IRid&amp;quot; TO &amp;quot;IRid&amp;quot;) as &amp;quot;IRHealthSafetyActions&amp;quot;,&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;({select &amp;quot;IRid&amp;quot;,&amp;quot;LineItemID&amp;quot;,&amp;quot;ActiontypeID&amp;quot;,&amp;quot;ActionCOM&amp;quot;,&amp;quot;ActionHS&amp;quot; from &amp;quot;smorris&amp;quot;.&amp;quot;IREnergyMeasureActions&amp;quot; as &amp;quot;IREnergyMeasureActions&amp;quot;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;relate &amp;quot;IRid&amp;quot; TO &amp;quot;IRid&amp;quot;) as &amp;quot;IREnergyMeasureActions&amp;quot;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;({select &amp;quot;IRid&amp;quot;,&amp;quot;LineItemID&amp;quot;,&amp;quot;ActiontypeID&amp;quot;,&amp;quot;ActionCOM&amp;quot;,&amp;quot;ActionHS&amp;quot; from &amp;quot;smorris&amp;quot;.&amp;quot;IRDiagnosticTestsActions&amp;quot; as &amp;quot;IRDiagnosticTestsActions&amp;quot;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;relate &amp;quot;IRid&amp;quot; TO &amp;quot;IRid&amp;quot;) as &amp;quot;IRDiagnosticTestsActions&amp;quot;, &lt;br /&gt;&amp;nbsp;&amp;nbsp;({select &amp;quot;IRCommentID&amp;quot;,&amp;quot;IRid&amp;quot;,&amp;quot;CommentTypeID&amp;quot;,&amp;quot;CommentText&amp;quot; from &amp;quot;smorris&amp;quot;.&amp;quot;IRComments&amp;quot; as &amp;quot;IRComments&amp;quot;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;relate &amp;quot;IRid&amp;quot; TO &amp;quot;IRid&amp;quot;) as &amp;quot;IRComments&amp;quot;&lt;/p&gt;&amp;nbsp;and I am trying have that data filtered by &lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;where [IRid] = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot; + IRlookup;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is working if I only use &lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;select * from [InspectionReports] where [IRid] = &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + IRlookup; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;But I missing half of the data I need.&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>