Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CommandBuilder vs Stored Proc for updating
Message
From
22/01/2010 09:32:56
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
22/01/2010 09:25:17
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01445437
Message ID:
01445441
Views:
38
>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/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform