In Vb.Net it is very easy to check any string whether it can convert to an integer or not with the help of IsNumeric function.
you can use this function like this:
IsNumeric(Expression As Object) as Boolean
You can pass any value within the function and it will return true if Expression can convert in Integer and false if it cannot.
Example
Private Function CheckNumeric(ByVal Expression As Object) As Boolean If IsNumeric(Expression) Then CheckNumeric = True Else CheckNumeric = False End If End Function
If we pass in function “222” then it will return true and if we pass “abcd” then it will return false