Hi I have a ASP.Net code below that need to query with MS SQL database.
"select SUM(ShopCartItem.Price-OfferedPrice) As Discount from ShopCartItem " & _
"Inner Join Product " & _
"On ShopCartItem.ProductID = Product.ProductID " & _
"Where(ShopCartItem.ShopCartID = @ShopCartID) And ShopCartItem.ProductID != @ProductID"
The MS SQL query is effectively:
select SUM(ShopCartItem.Price-OfferedPrice) As Discount
from ShopCartItem
Inner Join Product
On ShopCartItem.ProductID = Product.ProductID
Where(ShopCartItem.ShopCartID = @ShopCartID) And ShopCartItem.ProductID != @ProductID
Where @ShopCartID is a particular ShopCart (Fixed value, not a issue) and @ProductID is something variable values where it takes its value from another dataset.
The rationale for this code is because I need to get ProductIDs that are not eligible for discount due to the fact that the customer has bought the same item before during the offer peroid.
So my question how do I assign @ProductID to all values from another dataset. The dataset has only 1 column.