Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Datset to xml file problem

Posted on 2008-11-17
8
Medium Priority
?
219 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:CraigLazar
  • 4
  • 4
8 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 22987852
Because that is the way that it was designed, and you don't have much control over the output format.  You can apply an XSLT transformation to the output to get what you need.
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 22991442
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
0
 
LVL 4

Author Closing Comment

by:CraigLazar
ID: 31517490
thanks
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 22994183
Can you show me what you did differently?
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 22994481
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
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22994540
Is your date column as SMALLDATETIME or DATETIME column?
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 22994600
in sql its a datetime, does smalldatetime only store the date?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22994645
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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question