Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading & Saving Data
Message
De
27/08/2003 10:51:55
 
 
À
27/08/2003 04:22:51
Information générale
Forum:
ASP.NET
Catégorie:
XML
Divers
Thread ID:
00822107
Message ID:
00823779
Vues:
17
Victoria,

You need to use the DataSet.GetChanges() method. I typcially use two XML strings, one for changes and one for deleted rows (deleted rows need special processing). Something like this:
DataSet dsChanged = MyDataSet.GetChanges();
DataSet dsDeleted = MyDataSet.GetChanges(DataRowState.Deleted);

string ChangeXML = dsChanged.GetXML();
string DeleteXML = "";

if (dsDeleted != null)
{
    // The dsDeleted DataSet contains only the deleted rows.
    // However, the GetXML() method ignores deleted rows,
    // so you need to un-delete them first.
    dsDeleted.RejectChanges();
    DeleteXML = dsDeleted.GetXML();
}
~~Bonnie

>The WriteXml method wites the complete data to xml document.
>What about if I want to write only the changes?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform