473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Updating the database

I'm having a difficult time calling UPDATE when my 'WHERE" clause calls ID,
which is numeric and the primary key. I found that I can do a SELECT just
fine with "WHERE ID".. Is there something special about UPDATE that i'm not
getting? I've searched the internet but it appears that what I'm doing
should work.

Any help would be greatly appreciated.
if (modcustomer == "relate")
{
var modid1 = Request.Form ("modid1");
var modid2 = Request.Form ("modid2");
var relationship = Request.Form ("relationship");
var comments = Request.Form("comments");

SqlString = "UPDATE Customer SET Relationship = ' " + relationship + " '
WHERE ID = " + modid1;
connection.Execute (SqlString);

}

thanks,

Debbie Ehrlich
Reliable Software - Developers of Code Co-op®, Server-less version control
for distributed teams www.relisoft.com
Jul 20 '05 #1
3 2030
please disregard.
I solved my problem. My table field had a typo.
"Debra Ehrlich" <de****@relisoft.com> wrote in message
news:bf**********@brokaw.wa.com...
I'm having a difficult time calling UPDATE when my 'WHERE" clause calls ID, which is numeric and the primary key. I found that I can do a SELECT just
fine with "WHERE ID".. Is there something special about UPDATE that i'm not getting? I've searched the internet but it appears that what I'm doing
should work.

Any help would be greatly appreciated.
if (modcustomer == "relate")
{
var modid1 = Request.Form ("modid1");
var modid2 = Request.Form ("modid2");
var relationship = Request.Form ("relationship");
var comments = Request.Form("comments");

SqlString = "UPDATE Customer SET Relationship = ' " + relationship + " '
WHERE ID = " + modid1;
connection.Execute (SqlString);

}

thanks,

Debbie Ehrlich
Reliable Software - Developers of Code Co-op®, Server-less version control for distributed teams www.relisoft.com

Jul 20 '05 #2
I had this problem yesterday. I found that when I was updating using
an ID I had to take out the ''. This is what worked for me. Below,
my update only worked when I took out the '' from around " & .Charge &
". Maybe somebody else can explain why.

cnn.execute "Update tblCUSTOMER_FEE_STRUCTURE SET " & _
"Charge = " & .Charge & " where " & _
"ChargeCode = '" & .ChargeCode & "' and " & _
"CustomerID = '" & .CustomerID & "'"
if (modcustomer == "relate")
{
var modid1 = Request.Form ("modid1");
var modid2 = Request.Form ("modid2");
var relationship = Request.Form ("relationship");
var comments = Request.Form("comments");

SqlString = "UPDATE Customer SET Relationship = ' " + relationship + " '
WHERE ID = " + modid1;
connection.Execute (SqlString);

}

thanks,

Debbie Ehrlich
Reliable Software - Developers of Code Co-op®, Server-less version control
for distributed teams www.relisoft.com

Jul 20 '05 #3
Thanks! I made this change as well and it works beautifully. My
understanding is a numeral shouldn't have quotes around it. Only strings
should have them.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
1
by: gaosul | last post by:
I am non-programming scientist and I am using a Program called Easyarticles from Synaptosoft Inc., which is based the database program Access. Unfortunately, the owner of this company has...
3
by: Bucko | last post by:
How important do you guys feel locking a database is while updating/adding information? Do you do it with every app you make? Only very high volume (traffic) apps? I'm trying to decide if my app...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
1
by: jonbartlam | last post by:
Hi There I'm not sure what exactly is going wrong here. I'm writing an application that retreives a table from a database (tbl_internalfaults) and updates it. (Actually, just the status column will...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.