I’d like to know what is the best practice.
I’m exporting some data (tables) from my database to XML files so I can read my data from them.
To export, I’m using DataTable.WriteXml (c#)
Now to read, what is best? to import them into a dataset and use DataTable.Select to get the row I want or create an XPathDocument and use XPath to get the data? which performs best? I’m still learning xpath.
I’d like to know what is the best practice. I’m exporting some data (tables)
Share
Why not load the exported XML in using
DataTable.ReadXml(fileName)? If you exported your table data usingDataTable.WriteXml(file, XmlWriteMode.XmlSchema), then you can import it in to a newDataTableusing ReadXml(file).From an example in MSDN:
If that’s the case, I don’t see where you’d need XPath. If I’m misunderstanding your question, please let me know and I’ll update accordingly.
I hope this helps.