Click here to Skip to main content
15,913,854 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAccessing MS Exchange functionality Pin
Fernando A. Gomez F.3-Sep-07 14:56
Fernando A. Gomez F.3-Sep-07 14:56 
AnswerRe: Accessing MS Exchange functionality Pin
jontyler3-Sep-07 16:13
jontyler3-Sep-07 16:13 
GeneralRe: Accessing MS Exchange functionality Pin
Fernando A. Gomez F.3-Sep-07 17:00
Fernando A. Gomez F.3-Sep-07 17:00 
QuestionValidation Control please help!! Pin
papy-boom3-Sep-07 13:18
papy-boom3-Sep-07 13:18 
AnswerRe: Validation Control please help!! Pin
Christian Graus3-Sep-07 14:00
protectorChristian Graus3-Sep-07 14:00 
GeneralRe: Validation Control please help!! Pin
papy-boom3-Sep-07 14:18
papy-boom3-Sep-07 14:18 
GeneralRe: Validation Control please help!! Pin
Christian Graus3-Sep-07 14:48
protectorChristian Graus3-Sep-07 14:48 
Questioncreate store procedure for decrease stock with quantity [modified] Pin
hardyyanto3-Sep-07 8:35
hardyyanto3-Sep-07 8:35 
helo alll...,

this is my data:

my table is item(productid,stock) ,order(customerid,no_order), and orderdetail (no_order,productid,quantity)

example:

order and orderdetail displayed in gridview....

order is displayed like this:

--------customerid-------no_order

detail-------A---------------1

detail-------B---------------2

when i click detail in row 2, it's display orderdetail:

no_order_________productid_________quantity

____2________________c1________________2

____2________________p1________________3

i have make all this is ok. but i want to decrease stok in item with quantity in orderdetail.

my code in procedure like:

CREATE PROCEDURE [dbo].[order_item]
(

@productid AS varchar,
@quantity AS INT
)
AS
BEGIN
BEGIN TRANSACTION
DECLARE @no_order AS INT
DECLARE @stock AS INT

INSERT INTO [Orderdetail]
(

[ProductId],
[Quantity]
)
VALUES
(

@productId,
@quantity
)

SET @no_order = SCOPE_IDENTITY()
SET @Stock = (SELECT [Stock] FROM [item] WHERE [ProductId] = @productId)

UPDATE [item]
SET
[Stock] = @Stock - @quantity
WHERE
[ProductId] = @productId
COMMIT TRANSACTION
END
return

it can't work..

how about his true code in store procedure?

ok..., thx..


-- modified at 14:41 Monday 3rd September, 2007
AnswerRe: create store procedure for decrease stock with quantity Pin
Christian Graus3-Sep-07 9:54
protectorChristian Graus3-Sep-07 9:54 
QuestionKilling a certan Session. Pin
Saksida Bojan3-Sep-07 8:00
Saksida Bojan3-Sep-07 8:00 
AnswerRe: Killing a certan Session. Pin
Pete O'Hanlon3-Sep-07 8:50
mvePete O'Hanlon3-Sep-07 8:50 
GeneralRe: Killing a certan Session. Pin
Saksida Bojan3-Sep-07 9:52
Saksida Bojan3-Sep-07 9:52 
QuestionCode Execution Prevention Pin
Saksida Bojan3-Sep-07 7:55
Saksida Bojan3-Sep-07 7:55 
Questionasp.net page size (height and width of tables are dynamicaly changed) - a very serious problem Pin
codelinks3-Sep-07 6:44
codelinks3-Sep-07 6:44 
AnswerRe: asp.net page size (height and width of tables are dynamicaly changed) - a very serious problem Pin
Guffa3-Sep-07 7:34
Guffa3-Sep-07 7:34 
GeneralRe: asp.net page size (height and width of tables are dynamicaly changed) - a very serious problem Pin
codelinks3-Sep-07 7:40
codelinks3-Sep-07 7:40 
AnswerRe: asp.net page size (height and width of tables are dynamicaly changed) - a very serious problem Pin
Guffa3-Sep-07 8:46
Guffa3-Sep-07 8:46 
GeneralRe: asp.net page size (height and width of tables are dynamicaly changed) - a very serious problem Pin
Pete O'Hanlon3-Sep-07 9:10
mvePete O'Hanlon3-Sep-07 9:10 
AnswerRe: asp.net page size (height and width of tables are dynamicaly changed) - a very serious problem Pin
ChrisKo4-Sep-07 8:42
ChrisKo4-Sep-07 8:42 
Questionhow can insert master table information in separate page in crystal report? Pin
B.A3-Sep-07 5:10
B.A3-Sep-07 5:10 
QuestionHow to set value of third column if first two are null in sql Pin
rahul.net113-Sep-07 5:05
rahul.net113-Sep-07 5:05 
AnswerRe: How to set value of third column if first two are null in sql Pin
Talal Sultan3-Sep-07 5:13
Talal Sultan3-Sep-07 5:13 
AnswerRe: How to set value of third column if first two are null in sql Pin
B.A3-Sep-07 5:15
B.A3-Sep-07 5:15 
AnswerRe: How to set value of third column if first two are null in sql Pin
Christian Graus3-Sep-07 5:21
protectorChristian Graus3-Sep-07 5:21 
GeneralRe: How to set value of third column if first two are null in sql Pin
rahul.net113-Sep-07 6:16
rahul.net113-Sep-07 6:16 

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.