look ,
lets assume that i have 2 tables
first one called Products ( ProductID,ProductQuantity)
second one called OrdersIN (OrderID,ProductID,QuantityIN)
Products Have those rows
ProductID ProductQuantity
100 0
okay and then we make 2 orders to have those 2 rows like that
OrderID ProductID QuantityIN 10 100 50 11 100 20
then the Products Table looklike become like that
ProductID ProductQuantity 100 70
all of that done with small windows form and some buttons and textboxs okay
what i wanna do is ,,, how can i make change to the OrderID in QuantityIN and replace the value that added to the ProductQuantity with the new value to have a right Value in ProductQuantity
thats all ,,, i hope somebody help me what i have to search or look for to accomplish that
|
| Author: K Hari Prasad 03 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
write a stored procedure, pass as productid input
stored procedure contains following statement.
UPDATE Products SET QuantityIn = (SELECT SUM(QuanityIn) FROM OrdersIn WHERE ProductId = @ProductId) WHERE ProductId = @ProductId
|
| Author: vineeth kumar 03 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
hi make a stored procedure first for insert value and use datagridview to display the values in the form use buttons name save and inside that call the stored procedure
|