I am trying to update a table with the code below and I keep getting the following exception:
"You have an error in your SQL syntax: check the manual that <SNIP>... for the right syntax to use near "Versed 5 mg/ml ' at line 1.
Notice the " and ' surrounding the medication.
If I change the syntax to
"where AnestheticMedNum = ' "
it still bombs
(NOTE: the code window edited out the plus signs so the "t's" denote plus signs
/// <summary>Updates the table anesthmedsinventory with the new quantity adjustment</summary>
public static void updateMed_adj(string anesthMedName, double newQty, double qtyOnHand)
double adjQty = newQty + qtyOnHand;
string command = "UPDATE anesthmedsinventory set QtyOnHand = " t adjQty t "where AnestheticMedNum = " t DataConnection.getMedNum(anesthMedName,adjQty);