Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CommandBuilder vs Stored Proc for updating
Message
De
22/01/2010 09:32:56
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, É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:
01445441
Vues:
37
>Hi,
>
>I am sorry if this question has been asked before (and maybe even many times). But I can't seem to understand what is a better approach for updating database (SQL Server) from a dataset (e.g. of 1 table with 1 row).
>
>1. Calling stored procedure.
> With this approach, I have to "manually" create SqlParameter object and add a parameter for each column that has been changed. Seems like a lot of coding.
>2. Using SqlCommandBuilder. This approach seems to be less code as the work of creating an Update command is dynamically done by the adapter.
>
>I am probably simplifying too much. But to me the 2nd approach seems to be win-win. But do I not see something that make some developers use the 1st approach?
>
>TIA>

I used to be a big Stored Proc guy, but I have since started to use an ORM which creates SQL on the fly. I've heard lately that creating Stored Procedures for Data Access is purely "shaving the yak".

Anyway, to each their own, but since I stopped caring about creating a Stored Proc for everything I've noticed things starting to get done a lot faster.
Very fitting: http://xkcd.com/386/
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform