Click here to Skip to main content
16,014,664 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
MySqlConnection con = new MySqlConnection("Server=localhost;UID=root;Database=db_cignal");
                con.Open();
                MySqlCommand cmd = con.CreateCommand();
                //cmd.CommandText = "update inventory left join inventoryOut on inventory.TotalPrice = inventoryOut.TotalPrice set inventory.TotalPrice  = (inventory.TotalPrice - inventoryOut.TotalPrice) where inventory.Product=@Products";
                cmd.CommandText = "update inventory set inventory.TotalPrice = (inventory.TotalPrice - inventoryOut.TotalPrice) where inventory.Product=@Products";
                cmd.Parameters.AddWithValue("@Products", cbProductOut.SelectedItem.ToString());
Posted
Updated 11-Mar-15 21:02pm
v2
Comments
CHill60 12-Mar-15 4:58am    
Not very clear. Can you describe what you are trying to achieve and what happens with this code?
_bluRe_ 12-Mar-15 5:10am    
i wanted to subtract the inventory total price and inventoryout total price where the answer is placed in inventory db

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900