Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
How do I check if a variable is numeric
Old 01-17-2006, 09:28 AM How do I check if a variable is numeric
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi all...

I have a variable : Session("intLoan") which must be numeric as it is being written to a number field in access database.

Session("intLoan") is set from a form though and so the client could enter a character.

HOw do i check if this has happened.

cheers.

Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 01-17-2006, 11:55 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
use IsNumeric(Session("intLoan"))
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 01-17-2006, 11:57 AM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
wicked. thanks very muchMinaki.
Looking good there as a cheerleader. Keep it up
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Old 01-17-2006, 11:58 AM
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Try

Response.Write(IsNumeric(Session("intLoan")))

I think this will either give you a true or false response.

So...
'check loan
Dim loan_check
loan_check = IsNumeric(Session("intLoan"))

If loan_check then
'update database
Else
Response.Write("please enter a number")
End If
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Reply     « Reply to How do I check if a variable is numeric
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13263 seconds with 12 queries