Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

InfoPath mangling datetimes returned from SQL Server through web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard Swope - 06 Jan 2006 19:58 GMT
If I format my date to show as xml the date I set and send to the database
is correct. When I requery I get the correct data back. However, if I format
my date to anything else it drops it back five hours. It is an interesting
coincidence that I am on the eastern standard time -5:00.

I have seen different messages saying that xml serialization is mangling the
date, but when I look at it as XML it looks correct.

What is going on?
Howard Swope - 06 Jan 2006 23:27 GMT
It looks like the web service xml serialization of the datetime datatype
adds a time zone indication on to its text representation. Info path doesn't
interpret this properly. If you handle the OnAfterChange event for each
datetime field and strip off the timezone, InfoPath does the right thing.

           public void startDate_OnAfterChange(DataDOMEvent e)

           {

                 // Write your code here. Warning: ensure that the
constraint you are enforcing is

                 // compatible with the default value you set for this XML
node.

                 if (e.Site.text.Length == 33)

                       e.Site.text = e.Site.text.Substring(0,19);

           }

> If I format my date to show as xml the date I set and send to the database
> is correct. When I requery I get the correct data back. However, if I
[quoted text clipped - 5 lines]
>
> What is going on?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.