<?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: Main data connection using SQL view and problem with query data through stored proc</title><link>https://www.infopathdev.com:443/forums/thread/38099.aspx</link><pubDate>Thu, 05 Feb 2009 06:30:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38099</guid><dc:creator>amitshrivastava</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38099.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=38099</wfw:commentRss><description>&lt;p&gt;Hi Patrick, &lt;/p&gt;
&lt;p&gt;Thanks for the response, I appreciate your help. I&amp;nbsp;have not changed schema&amp;nbsp;to cause this issue, &amp;nbsp;I am still in development /test&amp;nbsp;mode, for this I followed following steps -&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;Create table (T1)&amp;nbsp;with&amp;nbsp;two columns&lt;/p&gt;
&lt;p&gt;2. Create a view (V1)&amp;nbsp;to select recods from T1&amp;nbsp; (I need to use view because for my final design I need to merge multiple tables etc). &lt;/p&gt;
&lt;p&gt;3. Create a simple stored proc to return all records from V1 (I need&amp;nbsp; stored proc to return data to infopath as the data need to be filter on complex logic for my final design). &lt;/p&gt;
&lt;p&gt;4. Create new Infopath with Main data connection based on view V1. &lt;/p&gt;
&lt;p&gt;5. Customize Query Button to execute stored Proc of step-3 for querying data. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Strange observation is - above setup works fine if I base Main connection of Form on table T1 insted of view V1. Based on error&amp;nbsp;message it seems some how stored proc is returning reference to table T1 insted of view V1 when I execute&amp;nbsp;SPROC through&amp;nbsp;XDocument.Query() as highlighted below -&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Element &amp;#39;{http://schemas.microsoft.com/office/infopath/2003/ado/dataFields}&lt;strong&gt;Table1 is unexpected&lt;/strong&gt; according to content model of parent element &amp;#39;{http://schemas.microsoft.com/office/infopath/2003/dataFormSolution}dataFields&amp;#39;.&lt;br /&gt;Expecting: {http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&lt;strong&gt;&lt;u&gt;}View1&lt;/u&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Any thoughts ?&lt;/p&gt;
&lt;p&gt;Thanks, again, appreciate your help greatly.&lt;/p&gt;
&lt;p&gt;Amit&lt;/p&gt;</description></item><item><title>Re: Main data connection using SQL view and problem with query data through stored proc</title><link>https://www.infopathdev.com:443/forums/thread/38093.aspx</link><pubDate>Thu, 05 Feb 2009 02:14:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38093</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38093.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=38093</wfw:commentRss><description>&lt;p&gt;Hi AmitShirvastava and welcom to the forum,&lt;/p&gt;
&lt;p&gt;This is most likely caused by a change in your database schema. Did you change your database columns recently? Open your XSN in Desgner mode. Go to Tools-&amp;gt;Convert Main Data source and then republish the form. See if that solves the problem. If not, you&amp;#39;ve run into InfoPath&amp;#39;s big limitation with SQL - when the schema changes your form breaks. That&amp;#39;s why people use Web Services - they provide an abstraction layer between the DB and the Form and if this abstraction layer is defined appropriately (using loose coupling) it can allow for schema changes on the server or client without breaking your live form submission process. We provide a Web Service that solves this problem. So, if you can&amp;#39;t get it working with Convert Main Data Source, it&amp;#39;s likely you changed your DB in a non forward-migratable way and you are hosed. If that&amp;#39;s the case, you may want to consider redoing your form to submit to a DB using a Web Service. Hope this helps. &lt;/p&gt;</description></item><item><title>Main data connection using SQL view and problem with query data through stored proc</title><link>https://www.infopathdev.com:443/forums/thread/38092.aspx</link><pubDate>Wed, 04 Feb 2009 23:57:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38092</guid><dc:creator>amitshrivastava</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38092.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=38092</wfw:commentRss><description>&lt;p&gt;Hello Team, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Hope someone can help me with this. &lt;/p&gt;
&lt;p&gt;I have Infopath 2007 form based on a view ( View-1)&amp;nbsp;in SQL2005, work without any issue when I query the data. Now I would like to return the data through stored proc which runs a select statment on View1 with some conditions in where clause. This is where I run into issue and get following error ---&lt;/p&gt;
&lt;p&gt;-------------------------------------------------------------------------------------------------------------------------------------------------------------------&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The query cannot be run for the following DataObject: Main connection&lt;br /&gt;The XML data returned from the data source does not match the XML Schema for this form. This discrepancy might be caused by the data source returning multiple rows when InfoPath expects only one.&lt;br /&gt;Element &amp;#39;{http://schemas.microsoft.com/office/infopath/2003/ado/dataFields}Table1 is unexpected according to content model of parent element &amp;#39;{http://schemas.microsoft.com/office/infopath/2003/dataFormSolution}dataFields&amp;#39;.&lt;br /&gt;Expecting: {http://schemas.microsoft.com/office/infopath/2003/ado/dataFields}View1.&lt;/p&gt;
&lt;p&gt;----------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;seems somehow stored proc is returing reference to table1 while form is expecting View1 as defined in Main data connection. Trying to make this work since 1:00 AM last night still no luck, any help will be apprecaited. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>