Click here to Skip to main content
15,915,160 members
Home / Discussions / Database
   

Database

 
GeneralRe: Thank you! Pin
Vertyg05-Jun-05 1:53
Vertyg05-Jun-05 1:53 
GeneralRe: Thank you! Pin
Christian Graus5-Jun-05 11:18
protectorChristian Graus5-Jun-05 11:18 
GeneralFunction returning Table (SQL) Pin
LIUCKAS31-May-05 0:28
LIUCKAS31-May-05 0:28 
GeneralExecuting a query Pin
Pothirajan C30-May-05 19:15
Pothirajan C30-May-05 19:15 
GeneralRe: Executing a query Pin
MasudM30-May-05 21:17
MasudM30-May-05 21:17 
GeneralRe: Executing a query Pin
Colin Angus Mackay30-May-05 22:18
Colin Angus Mackay30-May-05 22:18 
GeneralUpdate query Pin
jetset3230-May-05 1:19
jetset3230-May-05 1:19 
GeneralRe: Update query Pin
Christian Graus30-May-05 12:16
protectorChristian Graus30-May-05 12:16 
jetset32 wrote:
SELECT ProductID FROM ShoppingCart
WHERE ProductID = ProductID and s.CartID='" + Convert.ToString(cartID) + "'


This is returning more than one row. You need to make sure each cart can only contain each product once, or change your SQL, or do this:

UPDATE Products p, shoppingcart s
SET p.Prodquantity = (p.ProdQuantity - s.Quantity)
WHERE p.ProductID =(SELECT TOP 1 ProductID FROM ShoppingCart
WHERE ProductID = ProductID and s.CartID='" + Convert.ToString(cartID) + "'

The TOP 1 thing is a hack, there is obviously a problem in the data in your database.


Christian Graus - Microsoft MVP - C++
GeneralRe: Update query Pin
Anonymous2-Jun-05 3:37
Anonymous2-Jun-05 3:37 
GeneralRe: Update query Pin
jetset324-Jun-05 10:49
jetset324-Jun-05 10:49 
GeneralRe: Update query Pin
Christian Graus5-Jun-05 11:17
protectorChristian Graus5-Jun-05 11:17 
GeneralRe: Update query Pin
jetset3217-Jun-05 22:03
jetset3217-Jun-05 22:03 
GeneralRe: Update query Pin
Christian Graus20-Jun-05 13:30
protectorChristian Graus20-Jun-05 13:30 
GeneralRe: Update query Pin
jetset3221-Jun-05 20:16
jetset3221-Jun-05 20:16 
GeneralGet the updated record Pin
Yulianto.29-May-05 21:51
Yulianto.29-May-05 21:51 
QuestionSummarization of time - help please?? Pin
Masoud_TB29-May-05 19:39
Masoud_TB29-May-05 19:39 
GeneralAccess table schema Pin
RFickling29-May-05 17:44
RFickling29-May-05 17:44 
QuestionAdding a column in result set programically using SQL??? Pin
alex.barylski29-May-05 14:13
alex.barylski29-May-05 14:13 
AnswerRe: Adding a column in result set programically using SQL??? Pin
Colin Angus Mackay29-May-05 20:02
Colin Angus Mackay29-May-05 20:02 
Generalremove ignored words - indexing service Pin
a_r_2129-May-05 5:37
a_r_2129-May-05 5:37 
Generalmis , remove ignored words - *full-text catalog Pin
a_r_2129-May-05 12:54
a_r_2129-May-05 12:54 
Generalremove ignored words - indexing service Pin
a_r_2129-May-05 5:36
a_r_2129-May-05 5:36 
GeneralUsing SQL with MS access Pin
mhmo28-May-05 21:16
mhmo28-May-05 21:16 
GeneralRe: Using SQL with MS access Pin
Colin Angus Mackay28-May-05 21:52
Colin Angus Mackay28-May-05 21:52 
Generalhelp required Pin
virgo*28-May-05 11:42
virgo*28-May-05 11:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.