Need help to detect error in code for POS system
in the following code my method for updating qty in the Products table is not working:
14 Replies
What's not working
Describe "not working"
Does it just not do anything? Does it insert the data into a wrong database? Does it explode your microwave?
if (cancelOrder.cboInventory.Text == "yes" && cancelOrder.CancelQtyValue > 0)
{
dbcon.ExecuteQuery("UPDATE tbProduct SET qty = qty + " + cancelOrder.CancelQtyValue + " where pcode= '" + cancelOrder.txtPcode.Text + "'");
} this piece of code does not update to the products table
Also, I hope it's not actually production code that some company runs, but rather a school homework or some such
Because if not, that would mean your passwords are stored in plaintext
nah its schoolwork
Use a parametrized query
honestly i have no idead what is that
You do:
Already used it once
to be more specific i have multiple forms of the app this is just one of them
Then my advice is the same for all other forms
Once everything... or, well, the most critical parts at least, is up to spec and things still don't work, that's when we can easily look for issues
then what should i do then?
Angius
Use a parametrized query
Quoted by
<@85903769203642368> from #Need help to detect error in code for POS system (click here)
React with ❌ to remove this embed.
would you believe me the error was on the if statement "if (cancelOrder.cboInventory.Text == "yes" && cancelOrder.CancelQtyValue > 0)" on the sense that the combo box had alternatives "Yes" and "No" so for the program it would allways be no cause of the uppercase
well,