Posted on: 8/13/2014 8:44:31 PM | Views : 417

Hi,
I have been having some issues with some simple calculations done using aspx, and hope to have some input. The following is my code:

 command = new MySqlCommand("SELECT COUNT FROM XXX WHERE PARTNUM=\"" + xxx + "\"", connection);  reader = command.ExecuteReader();  reader.Read(); inventorycount = reader.GetString(0);   bool result = int.TryParse(inventorycount, out count);  int c = 0;  c = count + 2;
command = new MySqlCommand("UPDATE XXX SET COUNT='" + c.ToString() + "' WHERE PARTNUM=\"" + xxx + "\"", connection);
command.ExecuteNonQuery();

My problem is when I query for the value c after the update command, c does not come to the value of (count + 2). It will be always (count + 2 * 23). I have no idea where the 23 may be coming from. Would that be a compil ...

Go to the complete details ...