Datasets to XML

  • Thread starter Thread starter RC
  • Start date Start date
R

RC

Can anyone advice what you are meant to do if you have a dataset and want to
save it as a XML doc for opening in say excel. If that DS has time date
fields in the ouptuted data comes out as "2003-04-30T13:22:00.0000000+01:00"
as opposed to 2003-04-30 13:22"
I know it has somthing to to with timezones etc but am not sure what to do.
the code I am using is
Dim myXmlWriter As New System.Xml.XmlTextWriter(myFileStream, Nothing)

' Write to the file with the WriteXml method.

myXmlWriter.WriteStartDocument(True)



dsExp.WriteXml(myXmlWriter)

myXmlWriter.Close()
 
Hello,

You may try changing datatime format with DateTimeFormatInfo class or
CultureInfo class. If it doesn't help, then you need to perfrom a loop and
format the datatime strings in the xml file one by one.

Best regards,

Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2003 Microsoft Corporation. All rights
reserved.
--------------------
 
Back
Top