M
martinharvey via DotNetMonster.com
I would be very grateful if someone could help me with a stored procedure
syntax problem
I want to insert the value "OrderTotal" into databasetable("Newtable") column
"OrderTotal"
(money (8)). The value can be returned from the page (Dim amount As Decimal =
ShoppingCart.GetTotal() totalAmountLabel.Text = String.Format("{0:c}",amount)
or returned by the function "ShoppingCart.GetTotal".
This is the syntax i have tried, but I get the error message "Invalid column
name OrderTotal"
CREATE PROCEDURE SP_NewOrder
(@CartID char (36),@CustomerID Varchar (50),@OrderTotal decimal(8))
AS
INSERT INTO NewTable (FirstName,ProductID,OrderTotal)
SELECT Customer.FirstName,Products.ProductID,Ordertotal
From Customer,Products Join ShoppingCart ON Products.ProductID =ShoppingCart.
ProductID
WHERE Customer.CustomerID=@CustomerID AND ShoppingCart.CartID = @CartID
GO
Can anyone tell me where i am going wrong
many thanks
martin
syntax problem
I want to insert the value "OrderTotal" into databasetable("Newtable") column
"OrderTotal"
(money (8)). The value can be returned from the page (Dim amount As Decimal =
ShoppingCart.GetTotal() totalAmountLabel.Text = String.Format("{0:c}",amount)
or returned by the function "ShoppingCart.GetTotal".
This is the syntax i have tried, but I get the error message "Invalid column
name OrderTotal"
CREATE PROCEDURE SP_NewOrder
(@CartID char (36),@CustomerID Varchar (50),@OrderTotal decimal(8))
AS
INSERT INTO NewTable (FirstName,ProductID,OrderTotal)
SELECT Customer.FirstName,Products.ProductID,Ordertotal
From Customer,Products Join ShoppingCart ON Products.ProductID =ShoppingCart.
ProductID
WHERE Customer.CustomerID=@CustomerID AND ShoppingCart.CartID = @CartID
GO
Can anyone tell me where i am going wrong
many thanks
martin