 |
| 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
|
|
|
|

August 27th, 2003, 04:17 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

August 27th, 2003, 04:28 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
Its not VALUE! its VALUES:D
Always:),
Hovik Melkomian.
|
|

August 27th, 2003, 05:03 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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~~~ :)
|
|

August 27th, 2003, 05:09 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
send me ur Table structure.
Always:),
Hovik Melkomian.
|
|

August 27th, 2003, 08:27 AM
|
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 28th, 2003, 08:02 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

August 30th, 2003, 12:06 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
Didnt u set other fields to NOT NULL?
Its must be that in other case it ok since I know.
Always:),
Hovik Melkomian.
|
|

August 31st, 2003, 07:42 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi, u means when i do insert, set other fields to NOT NULL...?
best regard
life'Ng
|
|

August 31st, 2003, 11:04 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
not exactly! I mean if the other fields are NOT NULL u have to mention them too.
Always:),
Hovik Melkomian.
|
|

September 1st, 2003, 02:35 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |