<?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: Host Infopath Form using Form Control-Error at NewFromFormTemplate(infopath)</title><link>https://www.infopathdev.com:443/forums/thread/21575.aspx</link><pubDate>Tue, 10 Jul 2007 03:52:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21575</guid><dc:creator>nseresha</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21575.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21575</wfw:commentRss><description>&lt;p&gt;Thanks for your reply.&lt;/p&gt;&lt;p&gt;I created a new certifcate using Create Certificate Wizard of &amp;#39;Security and Trust&amp;#39; in &amp;#39;Form Options&amp;#39; of Infopath Form. It did work. Now I can see my Infopath form.&lt;/p&gt;&lt;p&gt;My next task for infopath form&amp;nbsp;was to include some controls, get them connected to data from SQL Express and update certain Master-child tables in the database on button click. I didnot include connection code but included namespaces (System.Data.SQLClient)&lt;/p&gt;&lt;p&gt;When I tried to do the same, I got the following exception...&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;strong&gt;InfoPath cannot open the selected form because of an error in the form&amp;#39;s code.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;strong&gt;The Microsoft .NET Framework 1.1 is not installed on your computer or the InfoPath primary interop assembly (PIA) is not registered. Use Add or Remove Programs in Control Panel to make sure that Microsoft .NET Framework 1.1 is installed or install it using Windows Update, then run Setup again to confirm that .NET Programmability Support is installed, or contact your system administrator.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;&lt;strong&gt;That assembly does not allow partially trusted callers.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;I followed &lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;&lt;a href="https://msdn2.microsoft.com/en-us/library/aa943009(VS.80).aspx"&gt;https://msdn2.microsoft.com/en-us/library/aa943009(VS.80).aspx&lt;/a&gt;&amp;nbsp; and done the following changes..&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;1. checked to refer all the PIA&amp;#39;s&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;2. made &amp;quot;Run all from my computer&amp;quot;&amp;nbsp; in control panel-&amp;gt;add/remove programs-&amp;gt;Microsoft office 2007-&amp;gt;change-&amp;gt;.Net programmability support-&amp;gt;Run all from my computer&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;3. Re-run .NET 1.1 software as I am using .Net 3.0.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;Finally I got my infopath form integrated in&amp;nbsp;new window of Smart Client Software Factory application. I am now stuck with the following issue that I couldnot trace as where to refer.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;I am trying to open a simple infopath form. get it fully trusted with certificate and write code in Visual Studio using &amp;#39;Programming&amp;#39;. --- ERROR here&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;Please do let me know how can I troubleshoot it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;&lt;strong&gt;Infopath cannot add Event Handler.Infopath has encountered an error. The Operation failed.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:11pt;line-height:115%;font-family:'Calibri','sans-serif';"&gt;Thanks in advance..&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: Host Infopath Form using Form Control-Error at NewFromFormTemplate(infopath)</title><link>https://www.infopathdev.com:443/forums/thread/21570.aspx</link><pubDate>Mon, 09 Jul 2007 20:11:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21570</guid><dc:creator>Shiraz Cupala</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21570.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21570</wfw:commentRss><description>&lt;p&gt;The first thing I would try is to get the code working outside hosting to see if the call is correct. That would narrow down the issue to a hosting issue or some other certificate/InfoPath issue. Could you try that and let us know how that goes?&lt;/p&gt;</description></item><item><title>Host Infopath Form using Form Control-Error at NewFromFormTemplate(infopath)</title><link>https://www.infopathdev.com:443/forums/thread/21543.aspx</link><pubDate>Mon, 09 Jul 2007 08:52:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:21543</guid><dc:creator>nseresha</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/21543.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=21543</wfw:commentRss><description>&lt;font color="#2b91af" size="2"&gt;&lt;font color="#000000"&gt;&lt;p&gt;I feel my issue needs a new thread relating to hosting Infopath on windows forms using FormControl. Please let me know incase any active/replied thread relating to the topic.&lt;/p&gt;&lt;p&gt;Scenario: I have a scenario where I need to show an infopath form in a new window on a button click. I could able to view it when no sql server connection is included.&lt;/p&gt;&lt;p&gt;I made the form under &amp;quot;Trusted site&amp;quot; and linked to a &amp;quot;Certificate&amp;quot; following the article &lt;a href="http://thorprojects.com/blog/archive/2007/06/30/670.aspx"&gt;http://thorprojects.com/blog/archive/2007/06/30/670.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now if I run the application, The following error is shown at NewFromFormTemplate&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;formControl1.NewFromFormTemplate(myInfopathForm);&lt;font size="2"&gt;&lt;p&gt;formControl1.SetSubmitToHostEventHandler(&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&amp;nbsp;&lt;strong&gt;InfoPath cannot create a new, blank form.&lt;br /&gt;InfoPath cannot open the form. To fix this problem, contact your system administrator.&lt;br /&gt;﻿﻿&lt;br /&gt;Form template: D:\testInfopath5.xsn&lt;br /&gt;InfoPath cannot load this form. Either the signature is corrupted, or the certificate used to sign this form is expired or revoked. Contact the author of the form.&lt;/strong&gt;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;formControl1.SetSubmitToHostEventHandler(&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;p&gt;&amp;nbsp;&lt;strong&gt;InfoPath cannot create a new, blank form.&lt;br /&gt;InfoPath cannot open the form. To fix this problem, contact your system administrator.&lt;br /&gt;﻿﻿&lt;br /&gt;Form template: D:\testInfopath5.xsn&lt;br /&gt;InfoPath cannot load this form. Either the signature is corrupted, or the certificate used to sign this form is expired or revoked. Contact the author of the form.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Please let me know way(s) to troubleshoot it.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I used &lt;font size="2"&gt;Microsoft.Office.Interop.InfoPath.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;ISubmitToHostEventHandler interface to access the methods.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#000000"&gt;Thanks in advance&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>