Import/export by using DataSet WriteXml and ReadXml
I just tried to create a simpel import/export feature in one of our applications based on XML. My first thought was: Create a typed dataset and for export just serialize it to XML with the WriteXml method and for import deserialize it by using ReadXml.
Well the write part created exactly the file that I wanted but the ReadXml did not work as expected. No exceptions occured but no data was read so I could not add the data to the database. I remembered that I probably had to do with a schema option. Either at the write or the read. I wanted the write to behave like it was doing now. So browsing MSDN gave me the answer that I had to use the XmlReadMode.InferSchema parameter to the ReadXml method. That uses typed dataset information to check for data consistency.
So now my simple import/export is working again and it appears that my (typed) dataset knowledge was a bit rusted by not using it for quite a while.