<?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: SetValue gives error when date data type</title><link>https://www.infopathdev.com:443/forums/thread/28006.aspx</link><pubDate>Wed, 16 Apr 2008 17:38:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28006</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28006.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28006</wfw:commentRss><description>&lt;p&gt;You were close: dMyDate.ToString(&amp;quot;yyy-MM-dd&amp;quot;) is missing one &amp;quot;y&amp;quot;.&lt;/p&gt;
&lt;p&gt;The easier method is dMyDate.ToString(&amp;quot;s&amp;quot;) which says to use the XML sortable format (which is what InfoPath is expecting) at: yyyy-MM-dd.&lt;/p&gt;
&lt;p&gt;If you make the field a &amp;quot;string&amp;quot; datatype then you miss out on a lot of useful built-in date validation. If you don&amp;#39;t care about the validation and you don&amp;#39;t need a valid date format, then string is what you want.&lt;/p&gt;</description></item><item><title>Re: SetValue gives error when date data type</title><link>https://www.infopathdev.com:443/forums/thread/28001.aspx</link><pubDate>Wed, 16 Apr 2008 16:34:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28001</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28001.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28001</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I finally figured it out.&amp;nbsp; I had to change the Date Picker to a string data type.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: SetValue gives error when date data type</title><link>https://www.infopathdev.com:443/forums/thread/28000.aspx</link><pubDate>Wed, 16 Apr 2008 16:28:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28000</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28000.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28000</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Yes the me.CreateNavigator() works.&amp;nbsp; I got the sample from MS&amp;#39;s site.&lt;br /&gt; &lt;/p&gt;&lt;p&gt;I still have the same problem.&amp;nbsp; &lt;/p&gt;&lt;p&gt;When I changed the format by using dMyDate.ToString(&amp;quot;yyy-MM-dd&amp;quot;) and then using xnMyForm.SelectSingleNode(&amp;quot;/my:SharePointTraining/my:dClassDate&amp;quot;, ns).SetValue(dMyDate), I still get the error regard the data type.&amp;nbsp; It seems that VSTA will not pass a date data type to an InfoPath form.&amp;nbsp; If I change the Date Picker to a string data type, it works.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: SetValue gives error when date data type</title><link>https://www.infopathdev.com:443/forums/thread/27974.aspx</link><pubDate>Tue, 15 Apr 2008 23:07:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27974</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27974.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=27974</wfw:commentRss><description>&lt;p&gt;The date format is a problem: &amp;quot;4/18/2008&amp;quot; is not a valid XML date... you need &amp;quot;2008-04-18&amp;quot;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not a VB expert, but is Me.CreateNavigator working? In C#, we us MainDataSource.CreateNavigator().... so I would assume that in VB it would be MainDataSource.CreateNavigator&lt;/p&gt;</description></item><item><title>SetValue gives error when date data type</title><link>https://www.infopathdev.com:443/forums/thread/27960.aspx</link><pubDate>Tue, 15 Apr 2008 19:39:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27960</guid><dc:creator>Michael Vasquez</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27960.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=27960</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I have been having problems trying to set the XPathNavigator in InfoPath form.&amp;nbsp; If I change the textbox from a date data type to a string data type, it works.&amp;nbsp; How can I convert or cast the XPathNaigator in InfoPath?&amp;nbsp; Here is what I have.&lt;/p&gt;&lt;p&gt;Dim xnMyForm as XPathnavigator = Me.CreateNavigator&lt;/p&gt;&lt;p&gt;Dim ns as XmlNamespaceManager = Me.NamespaceManager&lt;/p&gt;&lt;p&gt;dClassDate = getFriDate()&amp;nbsp;&amp;nbsp; &amp;#39; getFriDate() gets the date of the upcoming Friday.&amp;nbsp; If today is Tuesday, it will return the date of Friday as #4/18/2008#&lt;/p&gt;&lt;p&gt;&amp;#39;Here is where I get the error.&lt;/p&gt;&lt;p&gt;xnMyForm.SelectSingleNode(&amp;quot;/my:SharePointTraining/my:ClassDate&amp;quot;, ns).SetValue(dClassDate)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;#39;If I change the date Picker, ClassDate,&amp;nbsp; on the form to a string data type, it works.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;Any suggestions on how to make this work?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;TIA&lt;/p&gt;&lt;p&gt;Mike&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>