我已编写了有关MySql数据库的查询以更新表,但它给出了错误
string q = "UPDATE inventory_detail" +
" SET inventory_detail.Quantity = (inventory_detail.Quantity + '" + Convert.ToInt32(qty.Text) + "')" +
" FROM inventory_detail INNER JOIN Inventory" +
" ON inventory_detail.inventory_id = Inventory.Inventory_id" +
" where Inventory.name = '" + item.Text + "'AND loc_id = '" + loc_id + "'; ";
cmd.CommandText = q;
cmd.Connection = conn;
if (cmd.ExecuteNonQuery() > 0)
{
MessageBox.Show("Data Updated");
}