<?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: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36885.aspx</link><pubDate>Fri, 09 Jan 2009 17:55:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36885</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36885.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36885</wfw:commentRss><description>&lt;p&gt;Oh, right on! Good sluething!&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36883.aspx</link><pubDate>Fri, 09 Jan 2009 17:50:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36883</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36883.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36883</wfw:commentRss><description>&lt;p&gt;Hilary, I think that you may be proud of me.&amp;nbsp; I figured it out.&amp;nbsp; Appatently, the myAppointment.Start is looking for yyyy-mm-ddThh:mm:ss am(or pm).&amp;nbsp; My time&amp;nbsp;data looks like this 12/30/1899 12:00:00 AM(or PM) with the date always being the same because it is missing from the user input.&amp;nbsp; So, I added the T and then stripped off everything 11 spaces after the first &amp;#39;1&amp;#39; like this:&lt;/p&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;// Set the start date&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;myAppointment.Start = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Convert&lt;/font&gt;&lt;font size="2"&gt;.ToDateTime(StartDateSeed +&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;T&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;+ StartTimeSeed.Substring(StartTimeSeed.IndexOf(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;1&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)+11));&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I knew that taking your advice and checking out the stuff from MS would help!&amp;nbsp; Thanks Hilary!&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36882.aspx</link><pubDate>Fri, 09 Jan 2009 16:49:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36882</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36882.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36882</wfw:commentRss><description>&lt;p&gt;I have made a little progress.&amp;nbsp; The data that comes from the date field looks correct - IP is leaving the time off of it so there is no &amp;#39;T&amp;#39; so I just left that part of the code out.&amp;nbsp; In the time field, the data looks like this 12/30/1899 3:30:00 PM so it doesn&amp;#39;t have a T either.&amp;nbsp; I am making the assumption that the IndexOf(&amp;quot;T&amp;quot;) is looking for a T in the data, right?&amp;nbsp; So just for goofs, I tried a space to see if that would work and I get the same &amp;#39;less than zero&amp;#39; error, but if I remove the whole StartTimeSeed part, I get the date OK and the appointment is inserted but the time is 12 am (default I assume because we aren&amp;#39;t passing it).&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36880.aspx</link><pubDate>Fri, 09 Jan 2009 16:22:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36880</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36880.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36880</wfw:commentRss><description>&lt;p&gt;Hello Hilary!&amp;nbsp; Good to hear from you!&amp;nbsp; Getting a couple of different errors now:&lt;/p&gt;
&lt;p&gt;Error&amp;nbsp;1&amp;nbsp;The best overloaded method match for &amp;#39;System.Convert.ToDateTime(object, System.IFormatProvider)&amp;#39; has some invalid arguments&amp;nbsp;C:\Documents and Settings\dfisher\My Documents\InfoPath Projects\Customer Care Cincinnati\FormCode.cs&amp;nbsp;150&amp;nbsp;35&amp;nbsp;Customer Care - no code&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Error&amp;nbsp;2&amp;nbsp;Argument &amp;#39;2&amp;#39;: cannot convert from &amp;#39;string&amp;#39; to &amp;#39;System.IFormatProvider&amp;#39;&amp;nbsp;C:\Documents and Settings\dfisher\My Documents\InfoPath Projects\Customer Care Cincinnati\FormCode.cs&amp;nbsp;150&amp;nbsp;110&amp;nbsp;Customer Care - no code&lt;/p&gt;
&lt;p&gt;Just to be sure that I didn&amp;#39;t goof it up, here is what I have:&lt;br /&gt;&lt;/p&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;// Set the start date&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;myAppointment.Start = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Convert&lt;/font&gt;&lt;font size="2"&gt;.ToDateTime(StartDateSeed.Substring(0, StartDateSeed.IndexOf(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;T&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)), StartTimeSeed.Substring(StartTimeSeed.IndexOf(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;T&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;) + 1, StartTimeSeed.Length - StartTimeSeed.Substring(0, StartTimeSeed.IndexOf(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;T&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)).Length - 1));&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36877.aspx</link><pubDate>Fri, 09 Jan 2009 16:04:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36877</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36877.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36877</wfw:commentRss><description>&lt;p&gt;The error probably is because one of the calculations that is providing the length argument of the substring is negative (i.e., less than zero). So, now the magic question is &amp;quot;Which one?&amp;quot; I see a plus sign where I think you might want a comma.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;Convert.ToDateTime(StartDateSeed.Substring(0, StartDateSeed.IndexOf(&amp;quot;T&amp;quot;)), StartTimeSeed.Substring(StartTimeSeed.IndexOf(&amp;quot;T&amp;quot;)+1, StartTimeSeed.Length- StartTimeSeed.Substring(0, StartTimeSeed.IndexOf(&amp;quot;T&amp;quot;)).Length-1))&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;Try that instead. Notice after the substring that gets the date: StartDateSeed.Substring(0, StartDateSeed.IndexOf(&amp;quot;T&amp;quot;)) there is now a comma instead of a plus.&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36875.aspx</link><pubDate>Fri, 09 Jan 2009 15:14:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36875</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36875.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36875</wfw:commentRss><description>&lt;p&gt;Sorry to be such a pain, but I am afraid that I do not know much about writing code.&amp;nbsp; I am now getting this error:&lt;/p&gt;
&lt;p&gt;Length cannot be less than zero. Parameter name: length&lt;/p&gt;
&lt;p&gt;This is how I have it:&lt;/p&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;// Set the start date&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;myAppointment.Start = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Convert&lt;/font&gt;&lt;font size="2"&gt;.ToDateTime(StartDateSeed.Substring(0, StartDateSeed.IndexOf(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;T&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)) + StartTimeSeed.Substring(StartTimeSeed.IndexOf(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;T&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;) + 1, StartTimeSeed.Length - StartTimeSeed.Substring(0, StartTimeSeed.IndexOf(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;T&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)).Length - 1));&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36874.aspx</link><pubDate>Fri, 09 Jan 2009 14:26:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36874</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36874.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36874</wfw:commentRss><description>Hi, 
&lt;p&gt;You can get the only date value from the date and time field using the following.&lt;/p&gt;
&lt;p&gt;StartDateSeed.Substring(0, StartDateSeed.IndexOf(&amp;quot;T&amp;quot;))&lt;/p&gt;
&lt;p&gt;And the time from the date and time field using&lt;/p&gt;
&lt;p&gt;StartTimeSeed.Substring(StartTimeSeed.IndexOf(&amp;quot;T&amp;quot;)+1, StartTimeSeed.Length- StartTimeSeed.Substring(0, StartTimeSeed.IndexOf(&amp;quot;T&amp;quot;)).Length-1)&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36872.aspx</link><pubDate>Fri, 09 Jan 2009 14:12:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36872</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36872.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36872</wfw:commentRss><description>&lt;p&gt;That was the first thing that I thought of, but there are complications.&amp;nbsp; I am getting the data from/storing to a SQL DB as well as publishing the form to a SharePoint forms library.&amp;nbsp; The two fields in question are promoted to columns in the forms library and if I don&amp;#39;t have them formatted as DateTime, SP tries to stick the missing element in there for me so instead of the date I get 2009-01-09T00:00:00 and instead of the time I get 1899-1-1T09:05:30.&amp;nbsp; It is odd I know and probably something to do with our SP configuration, but that is something that I do not have any control over, so here I am.&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36870.aspx</link><pubDate>Fri, 09 Jan 2009 14:02:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36870</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36870.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36870</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Change the first field data type to Date instead of Date and Time. Similarly the second field data type to time instead of Date and Time.&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36869.aspx</link><pubDate>Fri, 09 Jan 2009 13:54:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36869</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36869.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36869</wfw:commentRss><description>&lt;p&gt;I think I may have figured it out.&amp;nbsp; the two fields that I am using to create the &lt;font size="2"&gt;myAppointment.Start are both date/time fields.&amp;nbsp; I have formatted them to display just the date in one field and just the time in the other field, but i think that IP is putting the date and the time in both fields, but just not displaying it.&amp;nbsp; Do you know how to strip the time off the first field and the date off the second field?&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36868.aspx</link><pubDate>Fri, 09 Jan 2009 13:41:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36868</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36868.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36868</wfw:commentRss><description>&lt;p&gt;myAppointment is referrming to the AppointmentItem Object for creating the appointment in the calendar.&amp;nbsp; Here is the rest of the code - maybe that will help:&lt;/p&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;//Add a reference to Microsoft Outlook 12.0 Object Library.&amp;nbsp;Create new instance of Microsoft.Office.Interop.Outlook.Application object: &lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Application&lt;/font&gt;&lt;font size="2"&gt; outlookApp = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Application&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Get the namespace&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;NameSpace&lt;/font&gt;&lt;font size="2"&gt; ns = outlookApp.GetNamespace(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;MAPI&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Create a receipient object that is going to be the organizer of the appointment&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Recipient&lt;/font&gt;&lt;font size="2"&gt; myOrganizer = ns.CreateRecipient(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;apcarroll&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;); myOrganizer.Resolve();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Open the shared calendar for the receipient&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;MAPIFolder&lt;/font&gt;&lt;font size="2"&gt; sharedCalendar = ns.GetSharedDefaultFolder(myOrganizer, Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;OlDefaultFolders&lt;/font&gt;&lt;font size="2"&gt;.olFolderCalendar);&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;//Create an instance of AppointmentItem object and set the properties: &lt;/p&gt;&lt;/font&gt;Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;_AppointmentItem&lt;/font&gt;&lt;font size="2"&gt; myAppointment = (Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;_AppointmentItem&lt;/font&gt;&lt;font size="2"&gt;)sharedCalendar.Items.Add(Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;OlItemType&lt;/font&gt;&lt;font size="2"&gt;.olAppointmentItem);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Get values for appointment fields&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Subject&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; SubjectField1 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/@WWALPH&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; SubjectSeed1 = SubjectField1.Value;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; SubjectField2 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/d:Lots/@community_description&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; SubjectSeed2 = SubjectField2.Value;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; SubjectField3 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/d:Lots/@szLotNumber_201&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; SubjectSeed3 = SubjectField3.Value;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Location&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; LocationField1 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/d:Lots/@szLotAddress_201&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; LocationSeed1 = LocationField1.Value;&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; LocationField2 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/@ConcatPh1&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; LocationSeed2 = LocationField2.Value;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Body&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; BodyField1 = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/d:WorkOrders/d:WorkOrderConcern/d:WorkOrderConcernInfo/@UpdatedInfo&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; BodySeed1 = BodyField1.Value;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;myAppointment.Subject = (SubjectSeed1+SubjectSeed2+SubjectSeed3);&lt;/p&gt;
&lt;p&gt;myAppointment.Body = BodySeed1;&lt;/p&gt;
&lt;p&gt;myAppointment.Location = (LocationSeed1 + LocationSeed2);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Get Values for Date/Time&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Start Date&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; StartDateField = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/d:WorkOrders/@DiagnoseDate&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; StartDateSeed = StartDateField.Value;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Start Time&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;font size="2"&gt; StartTimeField = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Buyers/d:WorkOrders/@DiagnoseTime&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; StartTimeSeed = StartTimeField.Value;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Set the start date&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;myAppointment.Start = &lt;/font&gt;&lt;font color="#008080" size="2"&gt;Convert&lt;/font&gt;&lt;font size="2"&gt;.ToDateTime(StartDateSeed StartTimeSeed);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// End date &lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;myAppointment.Duration = 60;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Set the reminder 15 minutes before start&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;myAppointment.ReminderSet = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;myAppointment.ReminderMinutesBeforeStart = 15;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Setting the sound file for a reminder: &lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;myAppointment.ReminderPlaySound = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Setting the importance: &lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//use OlImportance enum to set the importance to low, medium or high&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;myAppointment.Importance = Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;OlImportance&lt;/font&gt;&lt;font size="2"&gt;.olImportanceHigh;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;/* OlBusyStatus is enum with following values:&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt; 
&lt;p&gt;olBusy&lt;/p&gt;
&lt;p&gt;olFree&lt;/p&gt;
&lt;p&gt;olOutOfOffice&lt;/p&gt;
&lt;p&gt;olTentative&lt;/p&gt;
&lt;p&gt;*/&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;myAppointment.BusyStatus = Microsoft.Office.Interop.Outlook.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;OlBusyStatus&lt;/font&gt;&lt;font size="2"&gt;.olBusy;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//Finally, save the appointment: &lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// Save the appointment&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;myAppointment.Save();&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36867.aspx</link><pubDate>Fri, 09 Jan 2009 13:35:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36867</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36867.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36867</wfw:commentRss><description>&amp;nbsp; 
&lt;p&gt;Actually what is the data type of myAppointment?&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36866.aspx</link><pubDate>Fri, 09 Jan 2009 13:30:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36866</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36866.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36866</wfw:commentRss><description>&lt;p&gt;Additionally, I have found that if I omit just the +StartTimeSeed I get the appointment with the correct date, but a time of 12 am - I assume because the time element is missing.&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36865.aspx</link><pubDate>Fri, 09 Jan 2009 13:28:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36865</guid><dc:creator>BuildPro Guru</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36865.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36865</wfw:commentRss><description>&lt;p&gt;Good Morning Swathip.&amp;nbsp; Thank you for your assistance, but now I am getting this error:&lt;/p&gt;
&lt;p&gt;Cannot implicitly convert type &amp;#39;System.DateTime&amp;#39; to &amp;#39;Microsoft.Office.Interop.Outlook._AppointmentItem&amp;#39;&amp;nbsp;C:\Documents and Settings\dfisher\My Documents\InfoPath Projects\Customer Care Cincinnati\FormCode.cs&amp;nbsp;150&amp;nbsp;29&amp;nbsp;Customer Care - no code&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: String was not recognized as a valid DateTime.</title><link>https://www.infopathdev.com:443/forums/thread/36864.aspx</link><pubDate>Fri, 09 Jan 2009 13:18:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36864</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36864.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36864</wfw:commentRss><description>&lt;p&gt;Hi Guru,&lt;/p&gt;
&lt;p&gt;Instead of myAppointment.Start = Convert.ToDateTime(StartDateSeed+StartTimeSeed); , use the following code line.&lt;/p&gt;
&lt;p&gt;myAppointment = Convert.ToDateTime(StartDateSeed+ &amp;quot;T&amp;quot; +StartTimeSeed);&lt;/p&gt;</description></item></channel></rss>