I'm accepting a string value from the user via a text box in a form. It is then used in a query against a database table and although it is a string, I require the only characters entered to be whole numbers.
I've tried various methods, such as the INT32 and TryParse functions. However, I run into issues when attempting an IF ELSE or TRY CATCH to prevent anything from executing until the input is 'acceptable'.
What is the easiest way to allow whole numbers only to be entered into the text box, or to identify anything but whole numbers and fail the execution?