DataAdapter using commandbuilder's commands, not it's own.

  • Thread starter Thread starter Marina
  • Start date Start date
M

Marina

The commands that are generated by the SqlCommandBuilder are not quite
right. I am calling GetUpdateCommand and GetDeleteCommand, modifying the
results, and assigning them to the UpdateCommand and DeleteCommand
properties of the SqlDataAdapter.

However, when the update runs, it looks like the original commands that
SqlCommandBuilder creates are being used,instead of the commands assigned to
the UpdateCommand and DeleteCommand properties.

I thought the whole point was to be able to customize the commands, assign
them to the data adapter, and have the data adapter use those instead!

If I call Dispose on the SqlCommandBuilder, then that call destroys the
SqlCommand objects GetUpdateCommand and GetDeleteCommand created that I used
as the basis.

Any ideas?
 
Hi Marina,

Why don't avoid SqlCommandBuilder and design your adapters either at design
time or by hand?
 
Back
Top