1

So I've spent all day finding where the problem lies. If I don't use XML to load data into my DataSet (i.e. just grab it straight from a database or somesuch) then I have no problems at all.

However, I have to read it from an XML file and I am currently using DataSet.ReadXML(...) to achieve this. The XML has been written using DataSet.writeXML (before being transmitted over the wire by a WCF service).

Here is how it is loaded:

XmlTextReader xmlreader = new XmlTextReader(odhdotnet.GetAllMetadataXML(), XmlNodeType.Element, null);
AllData.ReadXml(xmlreader);

Using a DataSet with data loaded from XML breaks all DataView.RowStateFilter functionality.

DataViewRowState.ModifiedCurrent does not result in a view of all the modified rows because the rows never have their RowVersion set to anything other than 'current'.

I do not know what is going on here, or why it is happening. Any ideas? My feeling is that by loading the data via XML the DataSet for some reason is missing something?

Any help most appreciated!

Kind regards, Fugu

razlebe
  • 7,134
  • 6
  • 42
  • 57
Fugu
  • 361
  • 2
  • 6
  • 17

1 Answers1

1

Have you tried setting the XmlWriteMode to XmlWriteMode.DiffGram?

InBetween
  • 32,319
  • 3
  • 50
  • 90
  • Hi, sorry for the late reply but this worked. Note: You also have to load the DataSet schema (stored in XML with DataSet.WriteXMLSchema() or somesuch) before loading the XML (with the diffgram included) - otherwise it won't load any data. The great thing is that before I had to convert the date format stored in the xml into the correct one, this way, by loading the schema first, the DataSet does all the conversion for me if that makes sense. – Fugu Jun 07 '11 at 11:28