Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parent & Child
Message
De
05/08/2002 14:19:08
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Divers
Thread ID:
00686093
Message ID:
00686266
Vues:
50
>are you changing the adapter's updatecommand.commandtext per table update?<

No, we don't bother with the DataAdapter for updates, mainly because all our database access is through Stored Procedures (including updating). So after setting up your parameters in the SqlCommand.Parameters() collection, you use the SqlCommand.ExecuteNonQuery() to call your update Stored Procedure.


~~Bonnie

>I've been lurking on these multi-select discussions and I would like to know how you are dealing with updating the multiple tables when using a single data adapter. IE, are you changing the adapter's updatecommand.commandtext per table update?
>
>
>
>>What we've done in order to use more meaningful table names is to first generate typed DataSets and then further sub-class them to use different names. Here's an example of what I mean (I'm not putting in all the code, because it's on a different computer and I can't copy/paste to here, but you'll get the gist of it):
>>
>>
>>// This code is in a sub-class of the typed DataSet:
>>
>>public tableDataTable Customer
>>{
>>  get {return this.table;}
>>}
>>
>>public Table1DataTable Orders
>>{
>>  get {return this.Table1};
>>}
>>
>>// etc. for Table2, Table3 ...
>>
>>
>>It looks like a lot of work, but we've written a VFP tool (gotta love VFP's string handling capabilities!!) that will generate stuff to and from the Clipboard, so it's easy enough to just plug it into your sub-class.
>>
>>Hope this gives you some food for thought ...
>>
>>~~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