<?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: SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44323.aspx</link><pubDate>Tue, 14 Jul 2009 18:48:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44323</guid><dc:creator>ccarns</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44323.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44323</wfw:commentRss><description>&lt;p&gt;Be forwarned that this technique does not work on a web enabled form. So if your end goal is to have people fill it out who do not have infopath then you will need to use a workaround.&lt;/p&gt;</description></item><item><title>Re: SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44289.aspx</link><pubDate>Tue, 14 Jul 2009 11:56:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44289</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44289.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44289</wfw:commentRss><description>&lt;p&gt;Thanks a lot Jimmy, works perfect, fast and was really easy to implement in the current form.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Its good to know that there is a place where you can get answers around InfoPath if there are Problems/Questions.&lt;/p&gt;</description></item><item><title>Re: SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44286.aspx</link><pubDate>Tue, 14 Jul 2009 11:14:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44286</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44286.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44286</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hello again,&lt;/p&gt;&lt;p&gt;&amp;nbsp;It looks like you can accomplish what you want to do with some code like the following:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FileQueryConnection q = DataSources[&amp;quot;&lt;i&gt;&lt;b&gt;dataSourceName&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&amp;quot;].QueryConnection as FileQueryConnection;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; q.FileLocation = &amp;quot;&lt;i&gt;&lt;b&gt;address to XML file&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/i&gt;&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; q.Execute();&lt;/p&gt;&lt;p&gt;Then that data source should have the contents of the XML file you indicated.&amp;nbsp; You still have to do this on an existing data connection (that is, you can&amp;#39;t create a new one at runtime, but you can switch out the XML file).&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44284.aspx</link><pubDate>Tue, 14 Jul 2009 08:57:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44284</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44284.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44284</wfw:commentRss><description>&lt;p&gt;Hi danirrivas,&lt;/p&gt;
&lt;p&gt;thanks also for your answer, but i have still one question which confuse me a lot. You are selecting within your SecondaryDataConnection a Field with the XPATH: &lt;/p&gt;
&lt;p&gt;(&amp;quot;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;/dfs:myFields/dfs:queryFields/ns1:GetItem/ns1:WhereCondition&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;sure, this is only a example... but in my own SecondaryDataConnection i dont have any field which would fit a &amp;quot;where&amp;quot; condition , or even the String i must enter into InfoPath for the XML. So this wont work, or is there a way to &amp;quot;always&amp;quot; set a Where Field in every XML Query? i will keep searching, and try to find a possible way to modifiy the xml shema that there will be a working &amp;quot;where&amp;quot; condition. Maybe there is one.&lt;/p&gt;
&lt;p&gt;My Current XML Recieving DataConnection is: &lt;a href="http://servername/sites/germansite/Docs/_vti_bin/owssvr.dll?Cmd=Display&amp;amp;List={LISTID}&amp;amp;View={VIEWID}&amp;amp;XMLDATA=TRUE&amp;amp;FilterField1=InternalFieldName&amp;amp;FilterValue1=FieldValueToFilter"&gt;http://servername/sites/germansite/Docs/_vti_bin/owssvr.dll?Cmd=Display&amp;amp;List={LISTID}&amp;amp;View={VIEWID}&amp;amp;XMLDATA=TRUE&amp;amp;FilterField1=InternalFieldName&amp;amp;FilterValue1=FieldValueToFilter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If possible i would edit this string in real time, but good to know that there is also a way to work directly in the XML DataSource.&lt;/p&gt;</description></item><item><title>Re: SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44204.aspx</link><pubDate>Mon, 13 Jul 2009 12:32:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44204</guid><dc:creator>danirrivas</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44204.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44204</wfw:commentRss><description>&lt;p&gt;You can refresh a secondary data connection from code using the command &lt;em&gt;Execute&lt;/em&gt;,&amp;nbsp;something like this:&amp;nbsp;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; documentWhere = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.&lt;strong&gt;DataSources&lt;/strong&gt;[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;yourSecondaryDataSource&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].CreateNavigator();&lt;/font&gt;&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; fieldWhere = documentWhere.SelectSingleNode(&amp;quot;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;/dfs:myFields/dfs:queryFields/ns1:GetItem/ns1:WhereCondition&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.NamespaceManager);&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;fieldWhere.SetValue(&amp;quot;&lt;font color="#a31515"&gt;Here goes the query&lt;/font&gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataSources[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;yourSecondaryDataSource&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].QueryConnection.Execute();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Hope it helps :-)&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44199.aspx</link><pubDate>Mon, 13 Jul 2009 08:34:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44199</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44199.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44199</wfw:commentRss><description>&lt;p&gt;Thanks for your fast answer, about the second question. &lt;/p&gt;
&lt;p&gt;I think about if there is a way to create in real time (while the InfoPath form is open) new Secondary Connection, or even better, refresh a existing one. (XML retrieving DataSource, - only the URL had to be refreshed).&lt;/p&gt;</description></item><item><title>Re: SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44197.aspx</link><pubDate>Mon, 13 Jul 2009 08:25:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44197</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44197.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44197</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;You can access the secondary data sources by using the &lt;b&gt;DataSources&lt;/b&gt; collection, like this:&lt;/p&gt;&lt;p&gt;DataSources[&amp;quot;&lt;b&gt;&lt;i&gt;nameOfSource&lt;/i&gt;&lt;/b&gt;&amp;quot;]&lt;/p&gt;&lt;p&gt;So if I wanted to create an XPathNavigator to a data source called &lt;b&gt;Weevils&lt;/b&gt;, I would use:&lt;/p&gt;&lt;p&gt;DataSources[&amp;quot;Weevils&amp;quot;].CreateNavigator()&lt;/p&gt;&lt;p&gt;I&amp;#39;m not sure what to say for your second question.&amp;nbsp; I don&amp;#39;t fully understand it and I have a feeling that there may not be a way to do what you want.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>SecondaryDataSource - How to access ?</title><link>https://www.infopathdev.com:443/forums/thread/44196.aspx</link><pubDate>Mon, 13 Jul 2009 08:12:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:44196</guid><dc:creator>The_Holy_One</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/44196.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=44196</wfw:commentRss><description>&lt;p&gt;Well, i know how to access within my &amp;#39;CodeBehind&amp;#39; to the MainDataSources of the InfoPath Formular...&lt;/p&gt;
&lt;p&gt;MainDataSource. xyz ...&lt;/p&gt;
&lt;p&gt;But how to access the SecondaryDataSources ?&lt;/p&gt;
&lt;p&gt;SecondaryDataSource as Class or Object doesnt exist.&lt;/p&gt;
&lt;p&gt;And if i am already bother you with my question, i would be pleased if someone could explain to me how to create a SecondaryDataSource with CodeBehind. For example, you push a Button and a XML File will be connected which will perform as DataSource. The Fields wont change, only the Data itself.&lt;/p&gt;</description></item></channel></rss>