GetXML and date format

  • Thread starter Thread starter Anders Nilsson
  • Start date Start date
A

Anders Nilsson

Hello!

Can someone tell me how to control the date format when
using the GetXML method in the DataSet class?

I've been using the DataSet class for some time now and
am happy with the functionality it provides but haven't
yet figured out how to control the presentation of
certain datatypes like DateTime when the XML is generated
by using GetXML.

The default seems to be the full date and time format
which looks like this in the XML using an example of a
hireDate element: " <hireDate>1995-01-
01T00:00:00.0000000+01:00</hireDate>
"

Thanks,
Anders
 
Hi,

You can format Date values using either the XmlConvert class, or by
applying an XSLT transformation on the XML representation of the DataSet's
data. The following article has additional information and a code sample
on how to accomplish this.

811767 HOW TO: Format DateTime and Date Values in the XML Extracted from an
http://support.microsoft.com/?id=811767

Hope this information is helpful.

Harold Ommert
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.


Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
 
Back
Top