开发者

DataRowVersion not working when using DataSet.ReadXML(...) to load data

开发者 https://www.devze.com 2023-03-10 04:48 出处:网络
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.

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


Have you tried setting the XmlWriteMode to XmlWriteMode.DiffGram?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号