Fill date field with SQL data using VB.net - InfoPath Dev
in

InfoPath Dev

Fill date field with SQL data using VB.net

Last post 05-02-2012 02:12 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-02-2012 12:31 PM

    Fill date field with SQL data using VB.net

    Hello.. I have a date field on my form.. I am pulling in a datetime field from a SQL datasource.. When I use VB.net to write the value in the SQL datasource to the Infopath field the value is written as a date and time value and doe snot pass validation for the field. I have tried "tostring("MM/dd/yyyy")" and Infopath still complained it was not a date. Any ideas??
  • 05-02-2012 12:38 PM In reply to

    Re: Fill date field with SQL data using VB.net

    Your format if the field is just a date datatype should be "yyyy-MM-dd". If it is a date time, I think it is "yyyy-MM-ddThh:mm:ss".

    Hilary Stoupa

  • 05-02-2012 01:12 PM In reply to

    Re: Fill date field with SQL data using VB.net

    Yay!!! Thank you so much.. I was wondering if it wanted it switched around like that..
  • 05-02-2012 02:12 PM In reply to

    Re: Fill date field with SQL data using VB.net

    If you need to know how the XML data is stored, you can always use a form control to enter it (in this instance, a date picker), save the XML, and open the XML with a text editor. Then you can see the actual field values instead of whatever the formatted values are.

    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.