I've written a DataSet to a XML file using .WriteXML(FileName), and the DataSetName property of the dataset is the top-level tag in the file. However, when I try to read the file into a different DataSet using .ReadXML(FileName), the DataSetName isn't changed to the value of the top-level tag. Am I doing something wrong, or is ReadXML not supposed to set the DataSetName? Just strikes me as odd that it writes it out but won't read it in.
Here's my writing code, the XML file, and the reading code:
Writing:
dsNewReport.DataSetName = "Rejected"
dsNewReport.WriteXml(My.Application.Info.DirectoryPath & "/Reports/Incomplete/" & fileName)
The resulting XML:
<?xml version="1.0" standalone="yes"?>
<Rejected>
<SearchData>
//SNIP
</SearchData>
</Rejected>
Reading:
dsSearchReport.ReadXml(My.Application.Info.DirectoryPath & "/Reports/Incomplete/Search_" & Search_SEQ_GUID & ".xml")
If dsSearchReport.DataSetName = "Rejected" Then
return True
'DataSetName = dsSearchReport after the read
End IF