<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Setup a data connection using code</title><link>https://www.infopathdev.com:443/forums/thread/22263.aspx</link><pubDate>Thu, 09 Aug 2007 17:01:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22263</guid><dc:creator>admot</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22263.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=22263</wfw:commentRss><description>&lt;p&gt;From what I gather, creating a data connection in IP is the same thing as setting up an asp page.&lt;/p&gt;&lt;p&gt;Does anyone know the syntax to create a data connection to a web service via an asp page? &lt;/p&gt;&lt;p&gt;&amp;nbsp;I tried googling the proceedure/sample text but could not find anything specific to a web service. All the ones I found connect to a database.&lt;/p&gt;</description></item><item><title>Setup a data connection using code</title><link>https://www.infopathdev.com:443/forums/thread/22193.aspx</link><pubDate>Tue, 07 Aug 2007 16:57:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22193</guid><dc:creator>admot</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22193.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=22193</wfw:commentRss><description>&lt;p&gt;I would like to have a form that has a few data connections to a web service. The form will be available offline as well but there is no need. No need to setup a resource file to reference the pull downs. What I plan on doing is OnLoad, use IsDestinationReachable to see if the webservice can be reached. If it can, then setup the data connection to the web service (Note: This is an actual setup where code is used instead of going into Tools\Data Connections... ). If it cannot establish a connection, pull up a detailed popup indicating some pull downs won&amp;#39;t work but you can use them when you get online.&lt;/p&gt;&lt;p&gt;function XDocument::OnLoad(eventObj) &lt;/p&gt;&lt;p&gt;{ &lt;/p&gt;&lt;p&gt;if (0==Application.IsDestinationReachable(&lt;a href="http://%20--web/"&gt;http:// --web&lt;/a&gt; service&amp;#39;s website--)) &lt;/p&gt;&lt;p&gt;{ XDocument.UI.Alert(&amp;quot;The server is unavailable.&amp;quot;); } &lt;/p&gt;&lt;p&gt;else &lt;/p&gt;&lt;p&gt;{ XDocument.UI.Alert(&amp;quot;The server is available.&amp;quot;); } &lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Question: Is there a way to code a data connection setup? I performed a search but only could find this thread which didn&amp;#39;t provide much information. &lt;a href="http://www.infopathdev.com/forums/thread/13100.aspx"&gt;http://www.infopathdev.com/forums/thread/13100.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Overall, the goal is to allow the template to open when a data connection is not present w/out using a xml resource. The above is my attempt at this.&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;</description></item></channel></rss>