How to check whether the string is numeric or not in vb.net


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

Author: Ankur

Have worked primarily in the domain of Calling, CRM and direct advertisers services. My technological forte is Microsoft Technologies especially Dot Net (Visual Studio 2003, 2005, 2008, 2010 and 2012) and Microsoft SQL Server 2000,2005 and 2008 R2. My Area of Expertise is in C#. Net, VB.Net, MS-SQL Server, ASP. Net, Silverlight, HTML, XML, Crystal Report, Active Reports, Infragistics, Component Art, ComponeOne, Lead Tools etc.