private void NewBind() { try { MySqlConnection con = new MySqlConnection("Server=localhost;UID=root;Database=db_cignal"); con.Open(); MySqlCommand cmd = con.CreateCommand(); cmd.CommandText = "update inventoryOut.TotalPrice = (inventory.TotalPrice - inventoryout.TotalPrice) where inventory.Product = @Products"; cmd.Parameters.AddWithValue("@Products", cbProductOut.SelectedItem.ToString()); cmd.Prepare(); cmd.ExecuteNonQuery(); BindGridInventory(); con.Close(); } catch(Exception t) { MessageBox.Show(t.Message); } }
Product 1 100 stocks 1000 Total Price Product 2 50 stocks 500 Total Price
Product 1 10 stocks 100 Total Price Product 1 50 stocks 500 Total Price
Product 1 40 stocks 400 Total Price Product 2 50 stocks 500 total Price
Product 1 50 stocks 500 Total Price Product 2 50 stocks 500 total Price
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)