Link to home
Start Free TrialLog in
Avatar of CraigLazar
CraigLazar

asked on

Datset to xml file problem

Hi,
I have a dataset with a table in it and i am using the myDS.WriteXml("c:\test1.xml") function in vb.net 2005.
My dataset is built of a sql statement from SQL2005.
I have a date file and when i view it in debug mode the value is say 2008/11/17 12:00
but when it is written out to the xml file its in this format <QE_x0020_Date>2008-06-30T00:00:00+02:00</QE_x0020_Date>

Why is it adding T00:00:00+02:00

thanks
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CraigLazar
CraigLazar

ASKER

thanks,
i found away around it, in my sql select statements i am using convert and cast functions and its seems to be formatting the data correctly now.

cheers
thanks
Can you show me what you did differently?
well its giving me hassles again but what i did in my sql statement is i used the Convert funcion to convert the date field to a varchar(10),103 and then it comes down to my dataset and then writtn out to the xml file - but i am now having issues uding the datasapter on myweb service to return the adjusted data table.

hope this helps
Is your date column as SMALLDATETIME or DATETIME column?
in sql its a datetime, does smalldatetime only store the date?
SMALLDATETIME doesn't store the same precision for a date, so it loses some accuracy with seconds.  I only use DATETIME when I need that extra precision.