Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie - Problem Updating! - getting desperate!
Message
 
À
22/12/2003 12:58:20
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00861305
Message ID:
00861378
Vues:
28
Thank you, I haven't seen any of that before...
I'll bet you had to learn it the hard way!


>Rick,
>
>Here's the steps you need to do:
>
>1) Databind your controls ... it sounds like you've done this already.
>
>2) Before running the .Update() method, you need to verify that all proposed changes have been marked as modified rather than proposed ... there are two ways of doing this:
>
>// for each table:
>this.BindingContext[MyDataTable}.EndCurrentEdit();
>
>or
>
>for (int i=0; i < MyDataSet.Tables.Count; i++)
>{
>  for (int j=0; j < MyDataSet.Tables[i].Rows.Count; j++)
>  {
>    if (MyDataSet.Tables[i].Rows[j].HasVersion(DataRowVersion.Proposed))
>      MyDataSet.Tables[i].Rows[j].EndEdit();
>  }
>}
>
>I've had problems occasionally with the simpler method above (and it may just be something I didn't understand in the earlier days), and so I do the other one instead.
>
>3) After the .Update() completes successfully, the do:
>
>MyDataSet.AcceptChanges();
>
>
>Hope that helps,
>~~Bonnie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform