How to Create a Sell Button Code In Visual Studio C# with MySql as database : Hi Im Using Visual Studio C# and Im Having conflict on how to create a sell button as well how can I get the total amount of product that had been sold here is my code


               try
                {
                if (txtID.Text != "" && txtCategory.Text != "" && txtName.Text    != "" && txtQty.Text != "" && txtQty.Text != "" && PriceText.Text != "" && SuppNameText.Text != "")
                {
                    con.Open();
                    SqlCommand cmd = new SqlCommand("INSERT INTO Sold_Inventory (ProductName,Description,Category,Quantity_Sold,Price,TotalAmount,SuppliersName) VALUES(@ProductName,@Description,@Category,@Quantity,@Price,@Supplier)WHERE TotalAmount = @Quantity * @Price", con);
                    
                    cmd.Parameters.AddWithValue("@ProductName", txtID.Text);
                    cmd.Parameters.AddWithValue("@Description", txtName.Text);
                    cmd.Parameters.AddWithValue("@Category", txtCategory.Text);
                    cmd.Parameters.AddWithValue("@Quantity", txtQty.Text);
                    cmd.Parameters.AddWithValue("@Price", PriceText.Text);
                    cmd.Parameters.AddWithValue("@Supplier", SuppNameText.Text);
                    cmd.ExecuteNonQuery();
                    SqlCommand cmd1 = new SqlCommand("Update Quantity FROM Inventory SET Quantity = Quantity - @Quantity");
                    cmd1.Parameters.AddWithValue("@Quantity", txtQty.Text);
                    cmd1.ExecuteNonQuery();
                    con.Close();
                    ClearTextbox();
                    btnSearch.Enabled = true;
                    txtSearch.Enabled = true;
                    groupBox4.Enabled = true;
                    btnSubmit.Enabled = false;
                    btnCancel.Enabled = false;
                    ClearTextbox();
                    DisabledTextbox();
                    btnAdd.Enabled = true;

                    RefreshDGV(this.dataGridView1);
                }
                else
                {
                    MessageBox.Show("You left an empty field!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);

            }