UPDATE query in ASP.NET

G

Guest

Using Query Builder, I wrote a simple UPDATE query to update a single record
in an Access 2000 database. The query works fine when I run it from the
Query Builder in a OleDbCommand object by right-clicking the mouse.

"UPDATE tblJournal SET eventDescrip='New entry for Monday' WHERE
(eventID=791)"

However, when I open the same connection and call the same command object
using a click event in a WebControls.Button, the program runs but the record
is not updated. Yes, I make a change to the query to test if anything is
getting updated. And yes, the click event is getting triggered. Am I
missing something basic here?

This is how I try to run the query in the button click event:

me.connJournal.Open()
me.cmUpdateQueryTest.ExecuteNonQuery()
me.connJournal.Close()
 
K

Kevin Spencer

I don't see any association of your Command object to the Connection in your
posted code. In fact, I'm wondering why you're not throwing an exception
here.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top