Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Databinding Issue
Message
De
24/11/2010 10:47:01
 
 
À
23/11/2010 19:42:13
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01489807
Message ID:
01490379
Vues:
45
>After fiddling with this for a while, I tried the endedit and it worked.
>acceptchanges also works.
>
>Thanks for pointing me at it, Bonnie.
>
>
>Is there any functional difference between the two?
>The doc implies that the datasource will be updated. That's not happening, and I don't want it to.
>
>Under what circumstances would endedit cause the datasource to be updated?


In this case, "datasource" does NOT mean your backend database... it means your DataSet/DataTable/DataRow.

.EndEdit() and .AcceptChanges() are quite different! If you issue an .AcceptChanges() what happens is that any changes are no longer "marked" as changes in the DataSet/DataTable. So if you then want to update your backend database, you won't know what changed. .EndEdit() deals with DataRows that have a DataRowVersion of Proposed. Here's a good explanation of the row versions and the use of .EndEdit():

http://geek-goddess-bonnie.blogspot.com/2009/09/fun-with-datasets.html

~~Bonnie
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