GetXML and date format

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
 
H

Harold Ommert[MS]

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.
 

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