Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
how to give validation in vb.net to numeric and string field
Posted 15-Feb-13 23:03pm
Tulesh341
Comments
bandi.ramesh at 16-Feb-13 5:05am
   
where do you need it, server-side or client-side?
Maciej Los at 16-Feb-13 5:06am
   
Please, be more specific and provide more details.
Sandeep Mewara at 16-Feb-13 7:07am
   
Sounds straight forward. What have you tried so far?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Here is an example of one way to test that a string is all numeric:
Dim intNumber as integer=0
Dim strTestString as string = "123456"
Try
    intNumber = CInt(strTestString)
Catch
    Throw New System.Exception("Not Numeric")
End Try
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 410
1 Maciej Los 300
2 OriginalGriff 288
3 CHill60 190
4 Sinisa Hajnal 180


Advertise | Privacy | Mobile
Web03 | 2.8.141022.2 | Last Updated 17 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100