Use
Convert.toInt32(txtPrice.Text)
This is assuming VB.NET.
Judging by the name "txtPrice", you really don't want an Integer but a Decimal. So instead use:
Convert.toDecimal(txtPrice.Text)
If this is the case, be sure whatever you assign this to is Decimal not an Integer.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…