<?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>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Filter received Data Connection</title><link>https://www.infopathdev.com:443/forums/thread/85377.aspx</link><pubDate>Mon, 17 Dec 2012 19:37:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:85377</guid><dc:creator>kalehm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/85377.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=85377</wfw:commentRss><description>&lt;p&gt;I found it... Part of the codes come from this site &lt;a href="http://social.msdn.microsoft.com/forums/en-US/sharepointcustomizationlegacy/thread/403e6f25-ff23-472c-b414-c17866607181"&gt;http://social.msdn.microsoft.com/forums/en-US/sharepointcustomizationlegacy/thread/403e6f25-ff23-472c-b414-c17866607181&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Just if someone is looking for this my codes look like this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Get the name for&amp;nbsp;the InfoPath title&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; selectedXMLFile = MainDataSource.CreateNavigator().SelectSingleNode(&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;/my:myFields/my:Title1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Get the date&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; selectedDate = MainDataSource.CreateNavigator().SelectSingleNode(&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;/my:myFields/my:Date&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Retrieve the data connection &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;FileQueryConnection&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; con = (&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;FileQueryConnection&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)DataConnections[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;items&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;];&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Change the location of the data connection to point to the XML file created&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;con.FileLocation = &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;@&amp;quot;Server/_vti_bin/owssvr.dll&amp;quot;&lt;/p&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;?Cmd=Display&amp;amp;List={GUID}&amp;quot;&lt;/p&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;&amp;amp;XMLDATA=TRUE&amp;amp;noredirect=true&amp;amp;FilterField1=Training&amp;amp;FilterValue1=&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;+ selectedXMLFile + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot; - &amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + selectedDate + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;.xml&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Query the data connection to populate the InfoPath drop-down list box with items&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;con.Execute();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Retrieve a reference to the Main DOM&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; root = MainDataSource.CreateNavigator();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Count the amount of group2 nodes&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNodeIterator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; iter = root.Select(&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:gpContacts/my:gpContact&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;NamespaceManager);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; group2NodesCount = iter.Count;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Retrieve the first group2 node&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; firstGroup2NodeNav =&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:gpContacts/my:gpContact[1]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;NamespaceManager);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Retrieve the last group2 node&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; lastGroup2NodeNav =&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:gpContacts/my:gpContact[&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; +&lt;/p&gt;group2NodesCount.ToString() + &lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;NamespaceManager);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Delete the range of nodes from the first to the last group2 nodes&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;firstGroup2NodeNav.DeleteRange(lastGroup2NodeNav);&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Filter received Data Connection</title><link>https://www.infopathdev.com:443/forums/thread/85323.aspx</link><pubDate>Fri, 14 Dec 2012 15:29:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:85323</guid><dc:creator>kalehm</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/85323.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=85323</wfw:commentRss><description>&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;strong&gt;Hi to all!!&lt;/strong&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;First of all, I&amp;#39;m newbie on InfoPath.&amp;nbsp; I start like 5 days ago but I manage to do some crazy stuff and a lot of programming using a lot of codes from here and some other pages. But like any programmer, I don&amp;#39;t know everything... :( Let me put my scenario and see if someone has the codes that I need.&amp;nbsp; &lt;/span&gt;
&lt;ul&gt;
&lt;li style="LINE-HEIGHT:normal;MARGIN:0in 0in 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;" class="MsoNormal"&gt;&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;I have in SharePoint 2007 a Form Library and a List.&lt;/span&gt;&lt;/li&gt;
&lt;li style="LINE-HEIGHT:normal;MARGIN:0in 0in 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;" class="MsoNormal"&gt;&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;In my SharePoint Library and in the List there is a field call Training.&lt;/span&gt;&lt;/li&gt;
&lt;li style="LINE-HEIGHT:normal;MARGIN:0in 0in 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;" class="MsoNormal"&gt;&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;I have an InfoPath 2007 Form that use the codes from &lt;a href="http://msdn.microsoft.com/en-us/library/cc162745(office.12).aspx"&gt;&lt;span style="COLOR:blue;mso-bidi-font-size:11.0pt;"&gt;http://msdn.microsoft.com/en-us/library/cc162745(office.12).aspx&lt;/span&gt;&lt;/a&gt;&amp;nbsp;to connect to the List and fill it, and some fields that fill the data to the Library.&lt;/span&gt;&lt;/li&gt;
&lt;li style="LINE-HEIGHT:normal;MARGIN:0in 0in 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;" class="MsoNormal"&gt;&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;I manage to create a single button to submit both data.&lt;/span&gt;&lt;/li&gt;
&lt;li style="LINE-HEIGHT:normal;MARGIN:0in 0in 10pt;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1;tab-stops:list .5in;" class="MsoNormal"&gt;&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Even&amp;nbsp;I learn how to create a Web Part in SharePoint to show both data and filter the list base on what you select in the library.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;FONT-SIZE:10pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;I learn all this in just 5 days.&amp;nbsp; So far, so good. So, my problem is that I need to filter the List in the InfoPath Form so if you open a new Form the list in the Form appear empty and if you open a Form from the list that already you enter the items in the list appear in the Form.&amp;nbsp; Sorry for my English... My nature language is Spanish.&lt;/span&gt;</description></item></channel></rss>