title: Delete and Update Query in one
body: <pre><code>cmd1.CommandText = "Delete from tblindividualproduct where ProductID = @p1";
  cmd1.CommandText = "UPDATE tblproductinformation AS pInfo JOIN tblindividualproduct AS iProduct ON iProduct.Code = pInfo.Code SET pInfo.Quantity = pInfo.Quantity - 1 WHERE iProduct.ProductID = @p1";
  cmd1.Connection = conn;
  cmd1.Parameters.AddWithValue("@p1", "");
  for (int i = 0; i &lt; ids.Length; i++)
     {
        string val = ids[i];
        cmd1.Parameters[0].Value = val;
        cmd1.ExecuteNonQuery();
     }
  </code></pre>
  
  <p>i have tried this code but i cant seem to make it work. Update query is the only one working. I want to delete row on one table and update the quantity of the other table. how can i do this?</p>