Hi Shantanu,
If you use ExecuteNonQuery(), then
For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command.
So I think the number of rows updated may be greater than 1 so its error in your condition.
Try this
if (i > -1)
{
Response.Write("<script>alert('updated')</script>");
}
else
{
Response.Write("<script>alert('Failed')</script>");
}
Updated solution
I hope this is something wrong with concatenation,So try this
"quantity= quantity-'"+(Convert.ToInt32(qnt1.Text)+Convert.ToInt32(qnt2.Text))+"' where item='"+(Convert.ToInt32(item1.Text)+Convert.ToInt32(item2.Text))+"'";
Hope this helps you a bit.
Regards,
RK