Update command

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

Hi,

I want to change a field in a database directly using an update command, not
by changing a dataset first and then updating. I'm trying to use a command
similar to this:

updCommand.CommandText = "UPDATE CurTable SET CurField = '92' WHERE ID = 64"
adptestresults.update(MyDataSet.MyTable)

It doesn't work. The connection is open. No exceptions are thrown, nothing
happens at all. I am able to put a break on one of these lines and the
program breaks. Anyone know what's wrong?

Thanks,
Nathan
 
Hi Nathan,

You have to use the
SQLcommand.executeNonQuery for that, (or OLedb)

The dataadapter is for the dataset

But a better newsgroup for this kind of questions is

microsoft.public.dotnet.framework.adonet

I hope this helps?

Cor
 
Back
Top