WriteXml, DateTime, and Timezone data

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Greetings.
 
I am using a myDataSet.WriteXml(StringWriter) function (and then using the ToString() function to convert it to a string) to build an XML string based on the contents of my dataset.  This in itself works great.
 
I am then passing this string back to a PowerBuilder module that is taking this XML string and doing what it needs to do with it.  This is almost working great as well.  It works fine for all datatypes except DateTime (and Date, I presume).  The reason DateTime does not work is because of the TimeZone piece at the end.  If I strip this off, the PowerBuilder function (that translates the XML into the approprite PowerBuilder object) works just fine.  It would appear that PowerBuilder limits you on how you are able to read XML in.
 
So, my ultimate question is, back on the .NET side, is there a way to create my XML elements -- whose datatypes are DateTime -- without the TimeZone portion?  I'd still like to use the WriteXml function, since this is quite handy, but I realize that the solution might not be that simple.
 
For example,
WriteXml produces:    2006-06-01T00:00:00.0000000-05:00
I need:  2006-06-01T00:00:00.0000000   (No "-05:00" on the end)
 
I am a newbie to both XML and .NET in general, so the solution could be really obvious (or not).  Any help would be greatly appreciated.
 
Thank you,
 
Kevin


Relevant Pages

  • Re: Stream.Write / Encoding problem
    ... I would test converting xml string to base64 and sending that then ... request and you at least has a starting point. ... > request stream and write my XML string to it. ...
    (microsoft.public.dotnet.framework)
  • RE: XML as a WebService parameter
    ... \par From your description, you have an ASP.NET webservice which has a webmethod accepting a XML string parameter, and you'll get validation error when you call the webservice, correct? ... \par Generally, for XML webserivice, since its underlying message is encoded via SOAP XML, therefore, we should not directly pass parameter or return value of raw XML string content. ... \par Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Inserting XML String to a Text datatyped column
    ... retrieves and sends it back or use the sp_OA stored procedures to drive it ... you will be able to store it as either a string or XML datatype ... Best regards ... > This returns an XML string, ...
    (microsoft.public.sqlserver.xml)
  • XML reading database null value as an empty string ""
    ... I am using the XMLTextWriter to build an XML string and pass it to the ... When I get the data from SQL Server, ... varchar fields so I can get a NULL value rather than the empty string? ...
    (microsoft.public.dotnet.languages.csharp)