DataSet.WriteXML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vgullu
    New Member
    • Oct 2007
    • 2

    #1

    DataSet.WriteXML

    Migrated 2003 application to 2005 framework. In 2003 DataSet.WriteXM L, where one of the column as DateTime gives a value as \"1900-01-01T00:00:00.000 0000-05:00\" where frames are also the part of the value. But, in 2005 the same giving value as \"1900-01-01T00:00:00-05:00\", is not giving frames which is giving problem while saving. How can I achieve the same value as in 2003.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    I think you have to fiddle with the globalization settings to make the default DateTime format match that.
    I've never done it so I'm not sure how, but I think it can be found under the globalization thing.

    Comment

    • vgullu
      New Member
      • Oct 2007
      • 2

      #3
      Originally posted by Plater
      I think you have to fiddle with the globalization settings to make the default DateTime format match that.
      I've never done it so I'm not sure how, but I think it can be found under the globalization thing.
      Thanks for the reply,
      I tried setting the globalization, but it doesn't work.

      CultureInfo ci = (CultureInfo)Cu ltureInfo.Curre ntCulture.Clone ();
      ci.DateTimeForm at.LongDatePatt ern = "mm-dd-yyyy hh:mm:ss.ffffff ";
      Thread.CurrentT hread.CurrentCu lture = ci;

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Well, I guess you could always try writing your own .ToXML() function for DataSets?

        Comment

        Working...