Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 27th, 2003, 04:17 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default insert single value... pls help

hi,im trying to insert a single value('offShow') into a column(DbShow) in a table(Staff), but it cant work, it keep showing me the error ms to insert to db. any1 can give some suggestions? thanks

INSERT INTO Staff (DbShow) VALUE ('offshow') WHERE ID=8
INSERT INTO Staff (DbShow) VALUE (offshow) WHERE ID=8

Best regards
life's Ng

 
Old August 27th, 2003, 04:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Its not VALUE! its VALUES:D

Always:),
Hovik Melkomian.
 
Old August 27th, 2003, 05:03 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

hi, thanks for reply~~~ i thought if there is more than 1 value, then we use "Values"... anyway, i use update statement instead of insert, and its working~~~ statment as below:

dim strsql as string= "UPDATE Staff SET DbShow='offShow' WHERE ID= 8

n i've tried ur suggestion, it cant work still... don't misunderstand me, i just wish to learn more from each others.
thanks again~~~ :)

 
Old August 27th, 2003, 05:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

send me ur Table structure.

Always:),
Hovik Melkomian.
 
Old August 27th, 2003, 08:27 AM
Authorized User
 
Join Date: Jul 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

INSERT is used for adding NEW records to a table. UPDATE is used for updating EXISTING records. In this case you should be using UPDATE not INSERT. And as Melvik stated below it is always VALUES not VALUE.

 
Old August 28th, 2003, 08:02 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

Quote:
quote:Originally posted by melvik
 send me ur Table structure.

Always:),
Hovik Melkomian.
hi, this is my table structure, sorry for been late for reply
Name(text), Assignment(text), Mobile(text), DbShow(text), ID(auto num)

best regard
life's Ng

 
Old August 30th, 2003, 12:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Didnt u set other fields to NOT NULL?
Its must be that in other case it ok since I know.

Always:),
Hovik Melkomian.
 
Old August 31st, 2003, 07:42 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

hi, u means when i do insert, set other fields to NOT NULL...?

best regard
life'Ng

 
Old August 31st, 2003, 11:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

not exactly! I mean if the other fields are NOT NULL u have to mention them too.

Always:),
Hovik Melkomian.
 
Old September 1st, 2003, 02:35 AM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to life_s Ng Send a message via MSN to life_s Ng
Default

i c... but since i change to update statment n its work,i think it should be ok alrd. thanks alot~~
Pardon my ignorance, i am just a .net newbie

best regard
life's NG






Similar Threads
Thread Thread Starter Forum Replies Last Post
pls help me.. nilusharief003 ASP.NET 2.0 Professional 5 December 4th, 2008 08:05 AM
help pls.. heera BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 October 20th, 2007 05:25 PM
trigger to insert current date on insert kev_79 SQL Server 2000 3 January 23rd, 2006 05:58 PM
ASP.Net Single Single-on with Oracle Application S guhanath Oracle 0 October 6th, 2004 05:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.