Some Friends asked me : what is DiffGram in ado.net , here is answer and sample , enjoy it

Scenario : A salesperson has an application that loads a product stock list from an XML
file that he receives in an e-mail message each morning. The application
generates a DataSet from this file. During the day, the sales application is not
connected to the Internet. At the end of the day, the salesman uses the
application to generate an XML document that reflects the changes that he
made to the original DataSet, and then sends this file in an e-mail message to
the regional sales manager.
A DiffGram is an XML format, such as a file or stream, that represents changes
made to a DataSet. It contains the original and current data for an element or
attribute, and a unique identifier that associates the original and current versions
of an element or attribute to each other.
A DiffGram is useful when you want to send data across a network and
preserve the various versions of the data (Original or Current), in addition to the
Row State values (Added, Modified, Deleted, Unchanged) of the DataRows in a
DataSet.
=============
In the CustomerDataSet, the row with a CustomerID of ALFKI was modified.
In the resulting DiffGram, the new version of the row appears at the top of the
document and the original version appears inside the <diffgr:before> tag near
the end of the document:
<diffgr:diffgram
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<CustomerDataSet>
=====
<diffgr:before>
<Customers

posted on 2004-01-31 19:22  sqlDBAer  阅读(951)  评论(1编辑  收藏  举报

导航