<?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: The specified SQL statement is too complex for InfoPath to parse</title><link>https://www.infopathdev.com:443/forums/thread/22064.aspx</link><pubDate>Fri, 27 Jul 2007 16:38:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22064</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22064.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=22064</wfw:commentRss><description>&lt;p&gt;Awesome! Glad you found a solution. Thanks for sharing it here!&lt;/p&gt;</description></item><item><title>Re: The specified SQL statement is too complex for InfoPath to parse</title><link>https://www.infopathdev.com:443/forums/thread/22048.aspx</link><pubDate>Fri, 27 Jul 2007 13:01:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22048</guid><dc:creator>moestavern</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22048.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=22048</wfw:commentRss><description>&lt;p&gt;I just stumbled across this article &lt;a href="http://www.brettb.com/SQL_Help_Rowcount_Limit_Rows.asp"&gt;http://www.brettb.com/SQL_Help_Rowcount_Limit_Rows.asp&lt;/a&gt;&amp;nbsp;which says I could use a SQLServer ROWCOUNT variable to do what I want.&lt;/p&gt;&lt;p&gt;And it works, the SQL statement&amp;nbsp;I now issue via XDocument.Query() is:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;SET ROWCOUNT 500; select * from Products where short_text like &amp;#39;00%22&amp;#39;;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Without the set rowcount this gives me 1173 hits, now it gives me 500.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Cheers&lt;/p&gt;&lt;p&gt;moestavern&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: The specified SQL statement is too complex for InfoPath to parse</title><link>https://www.infopathdev.com:443/forums/thread/21936.aspx</link><pubDate>Tue, 24 Jul 2007 17:51:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21936</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21936.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=21936</wfw:commentRss><description>&lt;p&gt;Hmm, I see.&lt;/p&gt;&lt;p&gt;Another possibility is to leave the default SQL command in a way it works, and then use code to update the Command property of the data adapter object. I&amp;#39;m not sure if that will work any differently, but it might.&lt;/p&gt;</description></item><item><title>Re: The specified SQL statement is too complex for InfoPath to parse</title><link>https://www.infopathdev.com:443/forums/thread/21918.aspx</link><pubDate>Tue, 24 Jul 2007 08:27:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21918</guid><dc:creator>moestavern</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21918.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=21918</wfw:commentRss><description>&lt;p&gt;Hi Greg,&lt;/p&gt;&lt;p&gt;I went ahead and created a view and bound it to my form:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;CREATE VIEW [Top500Products] AS SELECT TOP(500) product_id,SHORT_TEXT,selected FROM Products&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;but then I thought, hey, that&amp;#39;s not gonna give me what I want.&lt;/p&gt;&lt;p&gt;My user types in a SHORT_TEXT, and the query issued will look like this: &lt;/p&gt;&lt;p&gt;&lt;strong&gt;SELECT [product_id],[SHORT_TEXT],[selected]&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;FROM [Test].[dbo].[Top500Products] &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;WHERE &amp;quot;SHORT_TEXT&amp;quot; LIKE &amp;#39;userinput%&amp;#39;;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This will give me all rows which contain a shorttext that starts with &amp;quot;userinput&amp;quot; and which are in the first 500 rows of the products table, in contrast to a maximum of 500 rows which contain a shorttext that starts with &amp;quot;userinput&amp;quot; and which are in the Products table.&lt;/p&gt;&lt;p&gt;Could you give me more details how my view needs to look like in order to achieve the behaviour of &lt;/p&gt;&lt;p&gt;&lt;strong&gt;SELECT TOP(500) FROM Products WHERE &amp;quot;SHORT_TEXT&amp;quot; LIKE &amp;#39;userinput%&amp;#39;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Thanks and cheers&lt;/p&gt;&lt;p&gt;moe &lt;/p&gt;</description></item><item><title>Re: The specified SQL statement is too complex for InfoPath to parse</title><link>https://www.infopathdev.com:443/forums/thread/21896.aspx</link><pubDate>Mon, 23 Jul 2007 16:31:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21896</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21896.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=21896</wfw:commentRss><description>Try creating a SQL View, and selecting the view instead of manually writing the select statement.</description></item><item><title>The specified SQL statement is too complex for InfoPath to parse</title><link>https://www.infopathdev.com:443/forums/thread/21876.aspx</link><pubDate>Mon, 23 Jul 2007 07:58:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21876</guid><dc:creator>moestavern</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21876.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=21876</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt;in my form I am trying to limit the number of hits the user gets when searching for products. As my product db will contain 40000+ entries, I do not want to display those in my form if the user doesn&amp;#39;t limit the search results.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So, I went ahead and followed this guide http://support.microsoft.com/kb/826992 to enable wildcards in my search.&lt;/p&gt;&lt;p&gt;Then, I modified the example so that in the end, the SQL statement issued is this one:&lt;/p&gt;&lt;p&gt;select TOP(10) &amp;quot;product_id&amp;quot;,&amp;quot;SHORT_TEXT&amp;quot; from &amp;quot;dbo&amp;quot;.&amp;quot;Products&amp;quot; as &amp;quot;Products&amp;quot; WHERE (&amp;quot;product_id&amp;quot; LIKE &amp;#39;test%&amp;#39;) AND (&amp;quot;SHORT_TEXT&amp;quot; LIKE &amp;#39;test%&amp;#39;)&lt;/p&gt;&lt;p&gt;Thsi gives me an error popup saying:&lt;/p&gt;&lt;p&gt;&amp;quot;Infopath cannot run the specified query. No query fields have been generated because the specified SQL statement is too complex for InfoPath to parse&amp;quot;&lt;/p&gt;&lt;p&gt;The SQL statement without the TOP(10) works fine:&lt;/p&gt;&lt;p&gt;select &amp;quot;product_id&amp;quot;,&amp;quot;SHORT_TEXT&amp;quot; from &amp;quot;dbo&amp;quot;.&amp;quot;Products&amp;quot; as
&amp;quot;Products&amp;quot; WHERE (&amp;quot;product_id&amp;quot; LIKE &amp;#39;test%&amp;#39;) AND (&amp;quot;SHORT_TEXT&amp;quot; LIKE
&amp;#39;test%&amp;#39;)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;How can I achieve to limit the number of hits ?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Cheers&lt;/p&gt;&lt;p&gt;moe&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>