Just a quick question.
Other than the way you manipulate them, are XMLDocuments and DataSets basically the same thing? I’m just wondering for speed issues.
I have come across some code that calls dataSet.getXML() and then traverses the new XMLDocument.
I’m just curious what’s the performance difference and which is the best one to use!
Thanks,
Adam
Very different.
A
DataSetis a collection of related tabular records (with a strong focus on databases), including change tracking.An
XmlDocumentis a tree structure of arbitrary data. You can convert between the two.For “which is best”…. what are you trying to do? Personally I very rarely (if ever) use
DataSet/DataTable, but some people like them. I prefer an object (class) representation (perhaps via deserialization), but xml processing is fine in many cases.It does, however, seem odd to write a
DataSetto xml and then query the xml. In that scenario I would just access the original data directly.