MySQL to dataSet - Date format problem RRS feed

  • Question

  • User-195907812 posted

    I have a problem retrieving dates from a MySQL database between my test and live environments.

    I am retrieving a bunch of records from a MySQL database and moving this data to a dataset.

    Dates are stored on both MySQL servers as "2011-07-13"

    When I move the data in to a dataset, the dates are as follows:

    Test system (correct)...


    Live system (incorrect)...

        <registration_submitted xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    Two questions...

    - Does anyone know what is causing the difference?

    - How can I modify my code to store dates in the desired format (as the test system).

    Wednesday, July 13, 2011 7:20 AM


All replies

  • User-195907812 posted


    I just dumped the dataSet to an XML file, this is what I found:


    <xs:element name="registration_submitted" type="xs:dateTime" minOccurs="0" />


    <xs:element name="registration_submitted" msdata:DataType="MySql.Data.Types.MySqlDateTime, MySql.Data, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d" type="xs:anyType" minOccurs="0" />

    Wednesday, July 13, 2011 9:50 AM
  • User-1694870838 posted


    please check your data format get from database,when move it  into dataset you can convert it format,

    about datetime format you can refer to this link:http://msdn.microsoft.com/en-us/library/aa325278(v=VS.71).aspx 

    Best Regards,


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 11:55 PM