Command Builder

V

vaishali

Hi all,
I am working with ADO.Net and have came across the command
builder object for transacting with the database. I would
like to know how effective is the CommandBuilder object
for implicitely generating insert/updatre/delete queries
using a Dataset and whether there are any disadvantages to
using this object.

Also I want to know whether it takes care of the order of
working with queries with respect to the Parent Child
tables... i.e inserting /updating the parent table before
the child table, etc.

Regards,
Vaishali
 
W

William Ryan

Commanbuilders are cool, but they are also a little
cumbersome. With Parent/Child stuff, you typically will
have two tables locally, and relate them with a
datarelation. Each dt can be handled with a
commandbuilder.

The main benefit of using it is much less code and if you
don't want to write a ton of update logic or are having
string parsing trouble with dynamic sql. Simlilarly, if
you don't know the structure of your query at design time,
or don't want to have to rewrite stuff every time you add
delete a db field...


The downside is slower performance. There's overhead with
the CB requesting and processing the metadata it needs to
make things happen. You also can't do much to override
the updates behavior. Also, forget using it with update
Stored procs and need optimistic concurrency turned off.
You'll probably have to write some specific exception
handlers to trap and deal with concurrency exceptions.

Hopefull this helps.

Bill


W.G. Ryan
(e-mail address removed)
www.knowdotnet.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top