<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Submit Using Code due to Timeout Error</title><link>https://www.infopathdev.com:443/forums/thread/43962.aspx</link><pubDate>Wed, 08 Jul 2009 15:49:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43962</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43962.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43962</wfw:commentRss><description>&lt;p&gt;Good Morning,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;After two months to have time to work on this, I finally got it.&amp;nbsp; The code is:&lt;/p&gt;
&lt;p&gt;function CTRL2114_7::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{ try &lt;/p&gt;
&lt;p&gt;{ XDocument.QueryAdapter.Timeout=240; &lt;/p&gt;
&lt;p&gt;XDocument.QueryAdapter.Submit(); &lt;/p&gt;
&lt;p&gt;XDocument.DataAdapters[&amp;quot;MainConnection&amp;quot;] &lt;/p&gt;
&lt;p&gt;XDocument.DataAdapters[&amp;quot;Submit&amp;quot;] .Submit(); &lt;/p&gt;
&lt;p&gt;XDocument.UI.Alert(&amp;quot;Document submitted successfully.&amp;quot;); &lt;/p&gt;
&lt;p&gt;eventObj.ReturnStatus = true; &lt;/p&gt;
&lt;p&gt;XDocument.SetDirty(false); &lt;/p&gt;
&lt;p&gt;XDocument.View.Window.Close(true); }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;catch(ex) &lt;/p&gt;
&lt;p&gt;{ XDocument.UI.Alert(ex.description); &lt;/p&gt;
&lt;p&gt;eventObj.ReturnStatus = false; } &lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;</description></item><item><title>Re: Submit Using Code due to Timeout Error</title><link>https://www.infopathdev.com:443/forums/thread/41621.aspx</link><pubDate>Wed, 13 May 2009 02:01:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41621</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41621.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41621</wfw:commentRss><description>&lt;p&gt;Hi Danielle and thank you for the thorough and thoughtful question! You&amp;#39;ve obviously done your homework.&lt;/p&gt;
&lt;p&gt;Your intuition is correct. Less code means less maintenance cost for you. Zero code forms are the best.&lt;/p&gt;
&lt;p&gt;Why is your form taking long to submit? Does your form have images or attachments? Is it a&amp;nbsp;server issue? That would be the root cause. Addressing the root cause is always better than just doing the workaround.&lt;/p&gt;
&lt;p&gt;There are many workarounds:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Add the timeout code. We can do this for you. It takes &amp;lt;30 minutes to add this to your form. You can donate some $$, send us the XSN, and we&amp;#39;ll do it for you. That&amp;#39;s one option.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Reduce the size of the&amp;nbsp;submitted form using something like our&amp;nbsp;free qRules library (which is code, but comes with an &amp;quot;injector&amp;quot;&amp;nbsp;so you don&amp;#39;t have to write or develop it). qRules&amp;nbsp;can be used to offload images&amp;nbsp;to separate ShP libraries&amp;nbsp;so the form size is reduced&amp;nbsp;and your submit time shortened.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Use a faster Web&amp;nbsp;Service to submit. SharePoint is slow. Qdabra&amp;#39;s Web Service (DBXL) can be used to speed up submits. However, this won&amp;#39;t have much of an impact if the XML data is large (&amp;gt;500kb on average). Here&amp;#39;s a link to comparison of using Web Service vs. SharePoint: &lt;a href="http://www.infopathdev.com/blogs/ernesto/archive/2009/01/07/dbxl-v2-3-performance-analysis.aspx"&gt;http://www.infopathdev.com/blogs/ernesto/archive/2009/01/07/dbxl-v2-3-performance-analysis.aspx&lt;/a&gt;. Why is SharePoint slow? Good question since it&amp;#39;s just a set of Web Services itself. Ask Microsoft! :)&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;You also asked about submitting to a database. Do you mean the SharePoint database? If you save to SharePoint or to our Web Service the XML form&amp;#39;s promoted properties will automatically be mapped to the SharePoint form library. &lt;/p&gt;
&lt;p&gt;You can definitely use data connections to submit to a Web Service. No code needed there. &lt;/p&gt;
&lt;p&gt;Let us know how we can help. &lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;</description></item><item><title>Submit Using Code due to Timeout Error</title><link>https://www.infopathdev.com:443/forums/thread/41603.aspx</link><pubDate>Tue, 12 May 2009 20:04:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41603</guid><dc:creator>Danielle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41603.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=41603</wfw:commentRss><description>&lt;p&gt;I have an Infopath form that is submitting to a database and SharePoint 2.0.&lt;/p&gt;
&lt;p&gt;This form and process is well over a year old.&amp;nbsp; I have been fighting a battle because SharePoint is timing out on our submits during heavy network traffic.&amp;nbsp; Today I received an email that I need to change the submit to be code and to add XDocument.QueryAdapter.Timeout = 120; XDocument.QueryAdapter.Query(); to the submit code.&lt;/p&gt;
&lt;p&gt;I have not written any code for this form in the past and I am really not sure where to start.&amp;nbsp; I have been using rules and the two dataconnections to submit.&amp;nbsp; So my questions are:&lt;/p&gt;
&lt;p&gt;1. Is there somewhere to change this code without having to rework the submit process?&lt;/p&gt;
&lt;p&gt;2. If not, What should the code look like, currently the code submits to an HTTP: address for SharePoint and to the &amp;quot;Main Connection&amp;quot; which is the database.&amp;nbsp; The form is also autonamed on Sharepoint using the ConCat function:concat(@Customer_Legal_Name, @Date_Requested)&lt;/p&gt;
&lt;p&gt;3. To submit to the database do we have to map each field back?&lt;/p&gt;
&lt;p&gt;4.&amp;nbsp; Is there code to submit using data connections and still be able to use the timeout settings above?&lt;/p&gt;
&lt;p&gt;Any help would be greatly appreciated.&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>