i have a numerical textbox which I need to add it\'s value to another number I have tried this code
String add = (mytextbox.Text + 2)
but
int intValue = 0; if(int.TryParse(mytextbox.Text, out intValue)) { String add = (intValue + 2).ToString(); }
I prefer TryPase, then you know the fallback is going to be zero (or whatever you have defined as the default for intValue)