473,770 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

isnumeric keyword

For Each item In Request.Form
If IsNumeric(item) Then
Try
Approved(item)
Catch ex As Exception
Response.Write( ex.Message)
End Try
End If
Next

this is code in vb.net to get all items whose check boxes are checked
i want to make same in c# what will be corressponding code
i am not getting IsNumeric in C#
what will be corresponding keyword against it
May 10 '06 #1
7 1900
There is no equivalent of IsNumeric in C# but see something very closely...
IsNumeric Function is in Microsoft.Visua lBasic namespace. So you can
reference Microsoft.Visua lBasic.Runtime assembly in your project and use all
Visual Basic Functions in C# ;) Cheers :)
"Vikas Kumar" wrote:
For Each item In Request.Form
If IsNumeric(item) Then
Try
Approved(item)
Catch ex As Exception
Response.Write( ex.Message)
End Try
End If
Next

this is code in vb.net to get all items whose check boxes are checked
i want to make same in c# what will be corressponding code
i am not getting IsNumeric in C#
what will be corresponding keyword against it

May 10 '06 #2
"Vikas Kumar" <ef*****@newsgr oups.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
what will be corresponding keyword against it


1) Launch your Internet browser (IE, FireFox, Mozilla, Netscape etc)

2) Navigate to http://www.google.com

3) Enter the text below in the box:

"C#" IsNumeric

4) Hit the button
May 10 '06 #3
An example of coding your own IsNumeric in C# can be found here:
http://www.tangiblesoftwaresolutions...0IsNumeric.htm
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"Vikas Kumar" wrote:
For Each item In Request.Form
If IsNumeric(item) Then
Try
Approved(item)
Catch ex As Exception
Response.Write( ex.Message)
End Try
End If
Next

this is code in vb.net to get all items whose check boxes are checked
i want to make same in c# what will be corressponding code
i am not getting IsNumeric in C#
what will be corresponding keyword against it

May 10 '06 #4
Actually, that's not true. IsNumeric is a managed function, and you can
access it on the Interaction class in the Microsoft.Visua lBasic namespace in
Microsoft.Visua lBasic.dll.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Altaf Al-Amin Najwani" <Al************ ****@discussion s.microsoft.com > wrote
in message news:9F******** *************** ***********@mic rosoft.com...
There is no equivalent of IsNumeric in C# but see something very
closely...
IsNumeric Function is in Microsoft.Visua lBasic namespace. So you can
reference Microsoft.Visua lBasic.Runtime assembly in your project and use
all
Visual Basic Functions in C# ;) Cheers :)
"Vikas Kumar" wrote:
For Each item In Request.Form
If IsNumeric(item) Then
Try
Approved(item)
Catch ex As Exception
Response.Write( ex.Message)
End Try
End If
Next

this is code in vb.net to get all items whose check boxes are checked
i want to make same in c# what will be corressponding code
i am not getting IsNumeric in C#
what will be corresponding keyword against it

May 10 '06 #5
Hi Vikas,
Thank you for posting.

Besides above solutions, here's a kb article:

How to implement Visual Basic .NET IsNumeric functionality by using Visual
C# .NET or Visual C# 2005
http://support.microsoft.com/default...en-us%3B329488
Regards,

Walter Wang
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 11 '06 #6
A problem with that KB article is that passing null to the method causes an
exception while the VB IsNumeric handles the VB equivalent Nothing.
See the following link for a more accurate C# equivalent:
http://www.tangiblesoftwaresolutions...0IsNumeric.htm
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"Walter Wang [MSFT]" wrote:
Hi Vikas,
Thank you for posting.

Besides above solutions, here's a kb article:

How to implement Visual Basic .NET IsNumeric functionality by using Visual
C# .NET or Visual C# 2005
http://support.microsoft.com/default...en-us%3B329488
Regards,

Walter Wang
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 12 '06 #7
Thanks David.

I agree with you on this. While the code in the kb produces correct result
regarding null value, it indeed incurs an unnecessary exception in
Double.TryParse () call.

Anyway, the easiest way is to simply use the version in
Microsoft.Visua lBasic.dll.
Regards,

Walter Wang
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 12 '06 #8

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

Similar topics

8
2323
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
13276
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
40143
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
2613
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...
7
2385
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...
3
1362
by: Vikas Kumar | last post by:
For Each item In Request.Form If IsNumeric(item) Then Try Approved(item) Catch ex As Exception Response.Write(ex.Message) End Try End If Next
8
2589
by: moondaddy | last post by:
What's the .net framework equivalent of the vb function isnumeric? If there isn't one, how can I test a string variable to see if its a number or not? I don't want to use isnumeric if possible -- moondaddy@noemail.noemail
12
3062
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)) {
17
2299
by: MLH | last post by:
I have tested the following in immed window: ?isnumeric(1) True ?isnumeric(1.) True ?isnumeric(1.2) True ?isnumeric(1.2.2)
0
9592
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...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
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
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.