Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# - Add and Update Records
Message
De
08/04/2008 19:10:59
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01309187
Message ID:
01309196
Vues:
28
Kevin,

Yes, you're on the right track, although we use the paradigm that if a zero key is passed then it's a new entry, otherwise the key is used to get the data.

Also, I wouldn't have the Form itself do any of that. It simply tells the Biz class (or a Web Service) to get a DataSet based on the key. The Form itself doesn't need to know if you're adding new data or updating existing data.

~~Bonnie






>Next newby question.
>
>I want to create a basic data entry form. In past VFP applications I accepted the PK of the record in the Init of
>the form. If the PK was passed, I loaded the record and entered Edit Mode. If no PK was passed, I assumed Add Mode.
>I don't see why I cannot do the same in my C# app:
>
>
>frmUser oUser = new frmUser();
>
>// If creating a new user...
>oUser.SetupForm();
>
>// If opening an existing user...
>oUser.SetupForm(iUserKey);
>
>oUser.ShowDialog();
>
>
>I'm open to other ideas on this.
>
>Next, when I am going into Add Mode, do I first create a data set, then add a row? Or is there some other way.
>An example would be helpful.
>
>Many thanks
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