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

updating database using parameters

P: n/a
Hi:
I have an access db that I'm accessing via ASP.Net. I'm using WebMatrix's
wizard to write the tedious db query code using parameters.
Select, insert, and delete work fine using the database parameters. I
can't seem to get the update code to work. If I write my own code using a
standard SQL statement like: "UPDATE db SET field='somevalue' WHERE
id=someinteger" : the update works properly. But with webmatrix's code, the
update doesn't occur. No error messages either, even with the try catch
blocks commented out.

I really need to use parameters here as the text boxes need to accept all
ascii characters, and I know what a single quote does to a SQL String.
If I cant get this problem solved, I'n going to have to set the update page
to first insert a new record then delete the old one. But I think that would
be the hard way .

CAn anyone make a suggestion?

Thanks,
Mark
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 13 May 2004 00:40:42 -0400, "Mark" <py*******@hotmail.com>
wrote:
Hi:
I have an access db that I'm accessing via ASP.Net. I'm using WebMatrix's
wizard to write the tedious db query code using parameters.
Select, insert, and delete work fine using the database parameters. I
can't seem to get the update code to work. If I write my own code using a
standard SQL statement like: "UPDATE db SET field='somevalue' WHERE
id=someinteger" : the update works properly. But with webmatrix's code, the
update doesn't occur. No error messages either, even with the try catch
blocks commented out.

I really need to use parameters here as the text boxes need to accept all
ascii characters, and I know what a single quote does to a SQL String.
If I cant get this problem solved, I'n going to have to set the update page
to first insert a new record then delete the old one. But I think that would
be the hard way .


Just before executing the SQL, have it print to the screen that actual
SQL statement generated. Most likely, if there are no errors, the
"someinteger" value is being set to a nonsense value like 0, or the
"somevalue" item is being set to the old value (less likely). If you
spit out the SQL code, you can see what is being asked.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.