473,388 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Check TextBox for int or string

MRW
I'm looking for a function that will take the value of a textbox and
see if it an integer or string.

Basically, I'm trying to add a simple search form with two overloaded
functions. If the search term is an int32, then it will run searchA;
if it's a string, then it will run searchB. At this point, even if the
textbox is full of numbers, it's still a string.

I'm having no luck finding anything on the web. Does anybody have
any ideas?

Thanks for any help!

Aug 26 '06 #1
2 1617
Int32.TryParse() if your using .net 2.0 or read this, tells you about a
range of options
http://aspalliance.com/80

Regards

John Timney (MVP)
"MRW" <mw*****@yahoo.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
I'm looking for a function that will take the value of a textbox and
see if it an integer or string.

Basically, I'm trying to add a simple search form with two overloaded
functions. If the search term is an int32, then it will run searchA;
if it's a string, then it will run searchB. At this point, even if the
textbox is full of numbers, it's still a string.

I'm having no luck finding anything on the web. Does anybody have
any ideas?

Thanks for any help!

Aug 26 '06 #2
MRW
Great! Thanks for the help!

John Timney (MVP) wrote:
Int32.TryParse() if your using .net 2.0 or read this, tells you about a
range of options
http://aspalliance.com/80

Regards

John Timney (MVP)
"MRW" <mw*****@yahoo.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
I'm looking for a function that will take the value of a textbox and
see if it an integer or string.

Basically, I'm trying to add a simple search form with two overloaded
functions. If the search term is an int32, then it will run searchA;
if it's a string, then it will run searchB. At this point, even if the
textbox is full of numbers, it's still a string.

I'm having no luck finding anything on the web. Does anybody have
any ideas?

Thanks for any help!
Aug 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Yuelin | last post by:
Hi there What's the best way of checking whether a textbox is empty? Thanks. Yuelin
2
by: MikeY | last post by:
Hi all, I am coding window forms in C#. My problem is this: I have created a "Check ListView" or a 'ListView' with checkbox's. I have populated the it with my files from my folders, mps, txt,...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
8
by: Sandy | last post by:
Hello - This code was snagged by me from the Internet and altered. Its purpose is to check for swear words. It works the way it currently is, but I need it to be more generic -- i.e., I don't...
6
by: Michael Turner | last post by:
Hi I have a form with multiple text fields and need a way of checking to see if changes are made in any of them I know I could use the keypress on each box but there must be an easier way. ...
2
by: Nikolay Petrov | last post by:
I have an app with text boxes used to change user password Textbox1 - old password Textbox2 - new password Textbox3 - new password second time What I need is how to check if the newely created...
3
by: RipperT | last post by:
Hello, I am using VB2005. I would like to check a textbox to see if it is blank using a Try Catch block. I assumed an easy way to do that would be to perform some action on the string that can't...
20
by: technocraze | last post by:
Hi guys & commnunity experts, Does anyone knw how to go about checking for existing data in an MS Acess table? I have tried out the following code using vb but doesnt seem to work that well? Can...
2
by: DesCF | last post by:
I have a textbox and a combobox on a toolstrip. The user enters either an ID in the textbox or selects a name from the combobox. When the user selects a name from the combobox the textbox is...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.