473,836 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET IsNumeric function

Joe
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In
VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any
trace of VB6 from my code.

TIA,
--
Joe
Feb 6 '06 #1
7 1908
Joe
Thanks.
--
Joe
"brians[MCSD]" wrote:
Hello Joe - do a search on this group for IsNumeric and you'll find an
enlightening thread from 1/15/2006. Essentially, the thread boils down to the
TryParse() method.

--
brians
http://www.limbertech.com
"Joe" wrote:
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In
VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any
trace of VB6 from my code.

TIA,
--
Joe

Feb 6 '06 #2
Hello Joe - do a search on this group for IsNumeric and you'll find an
enlightening thread from 1/15/2006. Essentially, the thread boils down to the
TryParse() method.

--
brians
http://www.limbertech.com
"Joe" wrote:
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In
VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any
trace of VB6 from my code.

TIA,
--
Joe

Feb 6 '06 #3
There is no direct equivalent in the .NET framework, but if you're using
VB.NET, IsNumeric is still a legitimate function that is not obsolete in any
way. So feel free to use it. For that matter, even if you're using C# you
can import the visual basic namespace and use the function that way. Some
things are just better about VB and that's ok.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Joe" <Jo*@discussion s.microsoft.com > wrote in message
news:80******** *************** ***********@mic rosoft.com...
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In
VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any
trace of VB6 from my code.

TIA,
--
Joe

Feb 6 '06 #4
The VB 2005 equivalent is IsNumeric().

Mike Ober.

"Joe" <Jo*@discussion s.microsoft.com > wrote in message
news:80******** *************** ***********@mic rosoft.com...
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In
VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any
trace of VB6 from my code.

TIA,
--
Joe


Feb 7 '06 #5
Joe
Thanks.
--
Joe
"Steve C. Orr [MVP, MCSD]" wrote:
There is no direct equivalent in the .NET framework, but if you're using
VB.NET, IsNumeric is still a legitimate function that is not obsolete in any
way. So feel free to use it. For that matter, even if you're using C# you
can import the visual basic namespace and use the function that way. Some
things are just better about VB and that's ok.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Joe" <Jo*@discussion s.microsoft.com > wrote in message
news:80******** *************** ***********@mic rosoft.com...
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In
VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any
trace of VB6 from my code.

TIA,
--
Joe


Feb 7 '06 #6
Joe
Michael,

In which namespace?
--
Joe
"Michael D. Ober" wrote:
The VB 2005 equivalent is IsNumeric().

Mike Ober.

"Joe" <Jo*@discussion s.microsoft.com > wrote in message
news:80******** *************** ***********@mic rosoft.com...
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In
VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any
trace of VB6 from my code.

TIA,
--
Joe


Feb 7 '06 #7
In the default namespace when I create a VB 2005 application.

Mike.

"Joe" <Jo*@discussion s.microsoft.com > wrote in message
news:5A******** *************** ***********@mic rosoft.com...
Michael,

In which namespace?
--
Joe
"Michael D. Ober" wrote:
The VB 2005 equivalent is IsNumeric().

Mike Ober.

"Joe" <Jo*@discussion s.microsoft.com > wrote in message
news:80******** *************** ***********@mic rosoft.com...
Hello All:

Does anyone know how someone would check for a numeric value in .NET? In VB6, we used IsNumeric. What's the .NET equivalent?

BTW, I know that I can harken back to IsNumeric. I'm trying to purge any trace of VB6 from my code.

TIA,
--
Joe



Feb 8 '06 #8

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

Similar topics

8
2325
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the following function in a validating class to use when needed. (Value = H880118A gave the error (like other 'unconvertible' strings)) Public Function Numeric(ByVal value) As Boolean
4
13278
by: Eugene Anthony | last post by:
I have received the following feedback for the two functions bellow: "The ISNUMERIC test is WORTHLESS for checking for an INT value, because ISNUMERIC will happily accept DOUBLE values, such as 89.11998811777 and other values that are simply *NOT* INT values." <% function isZip(input)
14
40151
by: Kenny | last post by:
Hello, I would like to know if the function IsNumeric requires a header like #include <iostream> to be functionnal thanks ken
8
2615
by: John Bowman | last post by:
Hello, Does anyone have a good/reliable approach to implementing an IsNumeric() method that accepts a string that may represent a numerical value (eg. such as some text retrieved from an XML file)? Thus if you pass it "1" or "5.12345" it returns true, but "1b3q" it returns false? I know VB has this sort of function, but was wondering how to implement something similar in C#. I suppose I could use the Convert methods and catch any...
10
2808
by: michele | last post by:
I have a problem with VB.Net and IsNumeric() function because it always returns FALSE even the string can be a number. There is another strange thing, the same program (it is a test) runs good on one and doesn't run an another one. The program test is very simple, just a form with a text box and a button. The text box has a validation rule that check if the insert string is a numeric value, that's all.
8
3239
by: Dave | last post by:
I'm trying to import Microsoft.VisualBasic to use the IsNumeric function in my C# code but all I see is: Microsoft.VisualBasic.VBCodeProvider while using Intellisense... From samples shouldn't I see Microsoft.VisualBasic.Information.IsNumeric? Thanks
7
2387
by: Nathan Truhan | last post by:
All, I think I may have uncovered a bug in the IsNumeric function, or at least a misunderstanding on functionality. I am writing a Schedule Of Classes Application for our campus and have a section that lists the Times, Buildings and rooms for courses. In this section I have a function called PadCell that takes3 parameters, one the value, one a padd count and one a a boolean input called StripNumeric, that if true, checks if the value...
9
8987
by: Kimelia Schiles | last post by:
Hi, I am new to C#, and I am a VB programmer. I would like to know whether there is any function in C# that can is similar to IsNumeric in VB?
12
3068
by: sck10 | last post by:
Hello, I am trying to determine if a value is NOT numeric in C#. How do you test for "Not IsNumeric"? protected void fvFunding_ItemInserting_Validate(object sender, FormViewInsertEventArgs e) if (e.NewValues != "" && Not IsNumeric(e.NewValues)) {
9
2316
by: =?Utf-8?B?VG9ueQ==?= | last post by:
Can anybody tell why IsNumeric("5-") is true?
0
9810
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9656
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10819
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10526
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6972
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5811
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4437
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3100
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.