Deleting a row

R

Ronny

When deleting a row I set the SelectCommand property in order to create the
dataset and the DeleteCommand property.
Do I have to set the InsertCommans and the UpdaeCommand also?

Regards
Ronny
 
R

Ronny

Thanks,
But this is exactly my question...
When using Update, in order to push data back to the database the ADO.NET
uses the prepared command automatically and I don't know if it needs also
those that I mentioned.
Regards
Ronny
 
D

daveL

if you have a identity key from your select
then the update will only up rows that were changed

I always build my own update command using the table.schema....
SqlcommandBuilder works wonders
for most if not all normal updates

work with it with test data till u get a handle with adapter.update()

try sqlcommandbuilder print the commands it creates out
so you can see what it is acually doing

DaveL
 
C

Cor Ligthert[MVP]

Yes,

But as Dave wrote, in most simple situations (by instance less than 100
columns, no broken columnnames and no relations) you can use the
commandbuilder much easier.

Cor
 

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