0

I have dataTable and I save it to file using DataTable.WriteXml

But when I try to load it using DataTable.ReadXml I get an exception:

Invalid Operation exception DataTable does not support schema interface from Xml

Anyone know how to solve this problem?

Avada Kedavra
  • 8,523
  • 5
  • 32
  • 48
  • Can you post the code your using? – Anil Jul 02 '11 at 20:06
  • I have found out what's the problem Instead of using table.WriteXml(fileLocation) You have to use table.WriteXml(fileLocation, XmlWriteMode.WriteSchema, true); and then when you try to load Xml file using table.ReadXml() everything works fine :) – Anthony Jul 02 '11 at 20:09
  • I'm blocked from posting answers as I'm not registered user. Could someone post it as replay? – Anthony Jul 02 '11 at 20:11

1 Answers1

0

Try using DataSet.ReadXml.

John Saunders
  • 160,644
  • 26
  • 247
  • 397