What is the use of CommandBuilder

Q

What is the use of CommandBuilder ?

✍: Guest

A

CommandBuilder builds “Parameter” objects automatically. Below is a simple code which uses commandbuilder to load its parameter objects.

Dim pobjCommandBuilder As New OleDbCommandBuilder(pobjDataAdapter)
pobjCommandBuilder.DeriveParameters(pobjCommand)

Be careful while using “DeriveParameters” method as it needs an extra trip to the Datastore which can be very inefficient.

2007-10-24, 4960👍, 0💬