By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Update command

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Cor
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
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?

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.