I have been trying for ages to convert a string taken from an input box in my asp form and converting it to an integer.
This integer variable will then be used for a database operation I have planned.
Here is what I have tryed:
string mytxtCHI = txtID.Text;
int @CHI = Convert.ToInt16(mytxtCHI);
Error:
System.FormatException {"Input string was not in a correct format."}
Things I have tried:
- string mytxtCHI = txtID.Text;
int myNewID=(Int32.Parse(txtID.Text));
Thankyou for your time :)