<?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: Error Traping in VB when calling Webservice/Dataconnection</title><link>https://www.infopathdev.com:443/forums/thread/22982.aspx</link><pubDate>Tue, 11 Sep 2007 22:45:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22982</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22982.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22982</wfw:commentRss><description>&lt;p&gt;Once you understand them and their true power in the world of programming, you&amp;#39;ll be using them all the time.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;</description></item><item><title>Re: Error Traping in VB when calling Webservice/Dataconnection</title><link>https://www.infopathdev.com:443/forums/thread/22866.aspx</link><pubDate>Tue, 04 Sep 2007 15:24:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22866</guid><dc:creator>Catharine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22866.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22866</wfw:commentRss><description>&lt;p&gt;Thank you. - I am a real newbie to VB I had not used these before.&lt;/p&gt;</description></item><item><title>Re: Error Traping in VB when calling Webservice/Dataconnection</title><link>https://www.infopathdev.com:443/forums/thread/22823.aspx</link><pubDate>Fri, 31 Aug 2007 23:28:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22823</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22823.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22823</wfw:commentRss><description>&lt;p&gt;Have you tried using Try/Catch statements?&lt;/p&gt;</description></item><item><title>Error Traping in VB when calling Webservice/Dataconnection</title><link>https://www.infopathdev.com:443/forums/thread/22632.aspx</link><pubDate>Fri, 24 Aug 2007 14:06:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22632</guid><dc:creator>Catharine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22632.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22632</wfw:commentRss><description>&lt;p&gt;Hi&amp;nbsp; I am using Infopath2007 and VB(real rookie - but finally making headway(I hope)).&lt;/p&gt;
&lt;p&gt;I have a Data Connection to a webservice.&amp;nbsp; Users can enter DisplayNamePart (3chars or more), and the&amp;nbsp;Webservice brings back the desired information.&amp;nbsp; All this is working well.&lt;br /&gt;BUT&lt;br /&gt;If the user enters &amp;quot;smi&amp;quot; for example there are too many records returned and an error message is displayed &lt;br /&gt;If the user enters &amp;quot;xyz&amp;quot;&amp;nbsp; there are no records and an error is displayed.&lt;br /&gt;Neither error is at all helpful to a user.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I would like to trap these errors and help the users to put the query right. - I understand what I have got to trap is a&amp;nbsp;&lt;i&gt;&lt;font size="1"&gt;System.Net.WebException&lt;/i&gt;:&lt;/font&gt;&lt;br /&gt;How do I do this in VB ? &lt;/p&gt;
&lt;p&gt;So far my code reads....&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; Datconcol &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; DataConnectionCollection = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;font size="2"&gt;.DataConnections&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; datcon &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; DataConnection = Datconcol.Item(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;UserInfo&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;datcon.Execute()&lt;/p&gt;
&lt;p&gt;I have thought about looking in the Secondary DataSource to see if there are values in the fields - but&amp;nbsp;this gives me another exception which I don&amp;#39;t know how to trap.&lt;/p&gt;
&lt;p&gt;Thank you for your help&lt;/p&gt;
&lt;p&gt;Catharine&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>