Datasets to XML

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()
 
L

Lion Shi

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.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top