I have a problem with my DataSet serialization to XML file. Every time I try to load the XML, the ReadXML() function throws the ArgumentNullException. What is interesting, this issue occurs only when I load it to the empty dataset. When I fill tables in my DataSet and then try to replace them loading DataSet from XML file, there is no Exception thrown. My DataTables are connected with relations. I do not use XMLScheme, because then my XML file never loads, even if I replace the existing dataset.
When the exception is thrown I have one table partly loaded: first record is loaded correctly and second one is filled by null values and StrongTypingExceptions.
Done anyone know what is going on ?
//edit:
Writing:
config.WriteXml(FileName,XmlWriteMode.IgnoreSchema);
Reading:
config.ReadXml(FileName,XmlWriteMode.IgnoreSchema);
I've tried all modes.
When schema is reading:
[System.Data.DataException] {"invalid 'key' node inside constraint: FK_SapTable_SapFieldFilter."} System.Data.DataException
I have two tables connected by relation FK_SapTable_SapFieldFilter. In table "SapTable" i have field TableId as key - it is never null. It is connected to TableId field in SapFieldFilter. My SapFieldFilter is an empty table for now, but it shouldn't make a problem: