472,145 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Numeric Validation in c#.net


I was get some data from a database. I wants to check the data is number or string. How can I solve this problem in c#.net?


Ram Prabu
Feb 8 '07 #1
2 4590
692 Expert 512MB

Use isNumeric to determine wheather its a number.If it returns False data is string as string can contain anything including numbers.

Feb 8 '07 #2
366 256MB

you can use a logic here just find the Ascii values characters and use a if

else condition ,thats all you can easily differentiate the numerics and

characters ,i was using the same logic but for some different purpose ,i

validated while inserting into the database.

Hope may help you..
Feb 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

30 posts views Thread by Dr John Stockton | last post: by
16 posts views Thread by Keith | last post: by
16 posts views Thread by tshad | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.