database - SQL, Change the number value of a field. In Visual basic -


im programming business application part of assignment , ran across problem have never had face before.

im wondering possible update value of field quantityonhand in statement without grabbing first statement , assigning variable.

google turning nothing im looking for, thanks!

        cmd = new oledbcommand("update inventory set quantityonhand = ? productid = ?", con)          prm = new oledbparameter("quantityonhand ", )         cmd.parameters.add(prm)          prm = new oledbparameter("productid ", "003")         cmd.parameters.add(prm)          cmd.executenonquery() 

the other answer pretty poor. wisety used parameters, embed expression in sql:

update inventory set quantityonhand = (quantityonhand  + ?) productid = ?  

pass positives increase, negative vals decrease


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -