Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CommandBuilder vs Stored Proc for updating
Message
 
 
À
22/01/2010 11:11:15
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01445437
Message ID:
01445525
Vues:
28
>>>>>
>>>>>Can you give us an idea of what you are trying to do? Maybe we can help..
>>>>
>>>>Say I have a dataset of one table with one row. And I need to create an UPDATE command to pass to a stored procedure. So far, in the book I am reading, I only found a way to do it by creating SQL parameter object and adding a parameter for each column that has been changed. And I don't know how to determine which columns have been change in a generic way. Does it make sense? TIA.
>>>
>>>Normally I would create an update SP that has parameters for all fields that could be updated, and pass those fields back whether they were updated or not. In general, that winds up being all fields for a table aside from the primary key.
>>
>>I understand. I will probably follow the same approach (if this is good enough for you, it will work for me too). Thank you.
>
>IMO, this is an inefficient way to handle the situation. If only one field has changed, you would be sending all fields to the sp and updating all fields. With a diffgram, you only update what has actually changed.
>
>http://msdn.microsoft.com/en-us/library/ms172088(VS.71).aspx

Thank you, John. The link is Not Found though. I will try to look for it other ways.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform