problems with Readxml Writexml in a dataset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John George

    problems with Readxml Writexml in a dataset

    I am writing the file correctly and it gives me the right xml file
    When I read it back, I am missing one element in the last row, it sets
    it to the initial value before I saved the origional file? Any ideas?
    Thanks,
    I am loading the xml file with this code;

    Dim myFileStream As New System.IO.FileS tream _
    (filename, System.IO.FileM ode.Create)
    ' Create an XmlTextWriter with the fileStream.
    Dim myXmlWriter As New System.Xml.XmlT extWriter _
    (myFileStream, System.Text.Enc oding.Unicode)
    ' Write to the file with the WriteXml method.
    thisDataSet.Wri teXml(myXmlWrit er)
    'for some reason the xml is skipping a Severity value
    ' RichTextBox1.Te xt = myXmlWriter.Wri teRaw
    myXmlWriter.Clo se()
    myFileStream.Cl ose()

    I am reading the xml file back with this code;

    ' Create new FileStream to read schema with.
    Dim fsReadXml As New System.IO.FileS tream _
    (xmlAd, System.IO.FileM ode.Open)
    ' Create an XmlTextReader to read the file.
    Dim myXmlReader As New System.Xml.XmlT extReader(fsRea dXml)
    ' Read the XML document into the DataSet.
    datasetRM.ReadX ml(myXmlReader)
    'datasetRM.Read Xml(xmlAd)

    myXmlReader.Clo se()
    fsReadXml.Close ()
Working...