<?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: Can I change the URL of a Rest datasource via code?</title><link>https://www.infopathdev.com:443/forums/thread/94240.aspx</link><pubDate>Tue, 12 Nov 2013 10:56:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:94240</guid><dc:creator>erum90</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/94240.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=94240</wfw:commentRss><description>Hello,

I am trying to get the current form in order to print it, also the print function is controled by a button on the form.

There could be as many as 8 forms open at once for the user, so I need to find the correct one in order to print it.</description></item><item><title>Re: Can I change the URL of a Rest datasource via code?</title><link>https://www.infopathdev.com:443/forums/thread/93135.aspx</link><pubDate>Wed, 18 Sep 2013 16:56:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93135</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93135.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=93135</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Graeme:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m still a bit confused about the difference between a DataSource and a DataConnection though.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;p&gt;They are essentially one and the same, but as far as the code goes, you use a DataSource object&amp;nbsp;to access a data source&amp;#39;s XML data, and use a DataConnection object to access its properties and/or execute it.&lt;/p&gt;</description></item><item><title>Re: Can I change the URL of a Rest datasource via code?</title><link>https://www.infopathdev.com:443/forums/thread/93129.aspx</link><pubDate>Wed, 18 Sep 2013 14:59:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93129</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93129.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=93129</wfw:commentRss><description>&lt;p&gt;Thanks, Jimmy - I hadn&amp;#39;t realized that!&lt;/p&gt;</description></item><item><title>Re: Can I change the URL of a Rest datasource via code?</title><link>https://www.infopathdev.com:443/forums/thread/93116.aspx</link><pubDate>Wed, 18 Sep 2013 06:49:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93116</guid><dc:creator>Graeme</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93116.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=93116</wfw:commentRss><description>&lt;p&gt;These 3 lines of code is exactly what I wanted. I&amp;#39;m still a bit confused about the difference between a DataSource and a DataConnection though. Will need to read the docs.&lt;/p&gt;&lt;p&gt;Thanks both. &lt;/p&gt;</description></item><item><title>Re: Can I change the URL of a Rest datasource via code?</title><link>https://www.infopathdev.com:443/forums/thread/93115.aspx</link><pubDate>Wed, 18 Sep 2013 05:47:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93115</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93115.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=93115</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hilary is absolutely right about interacting with the data connection object, but REST connections inherit from the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.filequeryconnection.aspx"&gt;FileQueryConnection&lt;/a&gt; class:&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;FileQueryConnection conn = (FileQueryConnection)DataConnections[&amp;quot;REST Web Service&amp;quot;];&lt;br /&gt;conn.FileLocation = &amp;quot;&lt;a href="http://server/someservice.svc?param1=a&amp;amp;param2=b"&gt;http://server/someservice.svc?param1=a&amp;amp;param2=b&lt;/a&gt;&amp;quot;;&lt;br /&gt;conn.Execute();&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Can I change the URL of a Rest datasource via code?</title><link>https://www.infopathdev.com:443/forums/thread/93098.aspx</link><pubDate>Tue, 17 Sep 2013 16:07:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93098</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93098.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=93098</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I think you instead need to look at the data connection and change the URL there: &lt;a href="http://msdn.microsoft.com/EN-US/library/microsoft.office.infopath.webserviceconnection.aspx"&gt;http://msdn.microsoft.com/EN-US/library/microsoft.office.infopath.webserviceconnection.aspx&lt;/a&gt;&amp;nbsp;might help.&lt;/p&gt;</description></item><item><title>Can I change the URL of a Rest datasource via code?</title><link>https://www.infopathdev.com:443/forums/thread/93096.aspx</link><pubDate>Tue, 17 Sep 2013 15:48:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93096</guid><dc:creator>Graeme</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93096.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=93096</wfw:commentRss><description>&lt;p&gt;I know there is a rule to do this, but I need to do it via code. I got a navigator to the datasource and was expecting to see XML with&amp;nbsp;atributes like URL etc. but see nothing.&lt;/p&gt;&lt;p&gt;Is this at all possible &amp;amp; how?&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;</description></item></channel></rss>