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

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?
 
M

Miha Markic

Hi Marina,

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

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