Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a Database Questions
Message
De
19/09/2004 11:02:14
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
17/09/2004 19:34:53
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00942400
Message ID:
00943835
Vues:
12
Bonnie,

Really? I mean, I use this method all the time and it works very well for me. Are we talking about the same thing?

For instance, I have a DataSet with 5 related tables, 1 grandparent, 1 parent, 1 many-to-many xref table, and 2 children. The way that I update all of the tables while avoiding constraint problems is to use a different DataAdapter for each table, then call .Update for the grandparent first, then the parent, then the 2 children, and finally the xref table.

Am I missing something important?

TIA

>Keith,
>
>But wouldn't the easiest method of updating the database be to use the DataAdapter's Update method?
>
>I think that gets a little difficult with multiple tables in the DataSet and the use of Stored Procs.
>
>~~Bonnie
>
>
>>>All,
>>>
>>> In the world of Microsoft programming there has always been more than one way to do something. My question pertains to what is the right or best way to get data from a dataset into the database when using a data adapter. The way I've done it now is the insert, update or delete command on the data adapter is set to the proper stored procedure in the database. Most of the stored procedures have parameters. In my code I update each of the parameters on the command and call the executenonquery method on the command. Hence the database is then updated, inserted or deleted. The problem gets to be that if there are a lot of parameters being passed to the stored procedure there is 1 line of code for each 1. Is there another or better method of updating a database?
>>>
>>>Any thoughts or other information would be greatly appreciated.
>>
>>Jim,
>>
>>I don't understand your question completely, so maybe this is off-base. But wouldn't the easiest method of updating the database be to use the DataAdapter's Update method?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform