473,385 Members | 1,907 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,385 software developers and data experts.

IsNumeric() IsDate() ...

Hi,

What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...

Thanks
--Michael
Nov 20 '05 #1
12 4724
Those methods are actually still there in
Microsoft.VisualBasic.Compatibility. They were afraid to take them out and
freak out all the VB6 developers. By default VB.NET projects reference this,
so these methods are available.

Other then that, you can use Int32.Parse,Double.Parse,DateTime.Parse, etc
method to check if something fits those data types. There will be an
exception thrown if whatever you are parsing can't be turned into that
particular datatype.

"Michael Ramey" <raterus@localhost> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...

Thanks
--Michael

Nov 20 '05 #2
> Hi,

What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...

Thanks
--Michael


You might look at Int32.Parse() and friends as well as DateTime.Parse() and
friends.

ChrisG
Nov 20 '05 #3
* "Michael Ramey" <raterus@localhost> scripsit:
What are the replacement methods in the .net framework for the old vb
functions such as IsNumeric(), IsDate(), etc...


There are no "replacements". These functions don't get "replaced".
They are valid part of VB.NET and there is no reason why they should not
be used any more.

For 'IsNumeric', you can use 'Double.TryParse' at the moment, although
thats not an 1:1 replacement. In .NET 2.0 (Whidbey, 2004) there will be
'TryParse' methods for other numeric datatypes like 'Integer' too. For
'IsDate' you can use 'DateTime.Parse' and/or 'DateTime.ParseExact' + an
exception handler ('Try...Catch').

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
"Marina" <so*****@nospam.com> schrieb
Those methods are actually still there in
Microsoft.VisualBasic.Compatibility.
Sure? ;-)
They were afraid to take them out and
freak out all the VB6 developers. By default VB.NET projects reference this, so these methods are available.


No, only the usual VB library is referenced by default, not the
compatibility library that should only be used for upgraded projects.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5

No, only the usual VB library is referenced by default, not the
compatibility library that should only be used for upgraded projects.

So they are not standard available?

Nov 20 '05 #6
"Cor [LVP]" <no*@non.com> schrieb

No, only the usual VB library is referenced by default, not the
compatibility library that should only be used for upgraded
projects.

So they are not standard available?


Why?
No, they are available.
--
Armin

Nov 20 '05 #7
Cor
Hi Armin,

Yes but that is not completly clear from your message.

You only say "sure ?" and not that they are normal in the

Microsoft.VisualBasic namespace

Cor
Nov 20 '05 #8
"Cor" <no*@non.com> schrieb
Hi Armin,

Yes but that is not completly clear from your message.

You only say "sure ?" and not that they are normal in the

Microsoft.VisualBasic namespace


After writing "sure?" I think she will see where it actually is.
--
Armin

Nov 20 '05 #9
Cor
Hi Armin,

I sended it in my calm down period.

Cor
Nov 20 '05 #10
I didn't remember exactly where it was and didn't bother to look it up. My
point was that it was in a DLL created specifically to make VB6 to VB.NET
transition easier.

"Armin Zingler" <az*******@freenet.de> wrote in message
news:en****************@TK2MSFTNGP11.phx.gbl...
"Cor" <no*@non.com> schrieb
Hi Armin,

Yes but that is not completly clear from your message.

You only say "sure ?" and not that they are normal in the

Microsoft.VisualBasic namespace


After writing "sure?" I think she will see where it actually is.
--
Armin

Nov 20 '05 #11
Cor
But that is not Marina

That is our point it is a part of the framework

While the compatibly is not.

:-)

Cor
I didn't remember exactly where it was and didn't bother to look it up. My
point was that it was in a DLL created specifically to make VB6 to VB.NET
transition easier.

Nov 20 '05 #12
Not necessarily true. The VB runtime DLL is the standard VB function
library, and IsDate/IsNumeric are part of that library.
The functionality that has been depreciated and/or was built specifically
for easing migration lives in the Compatibility DLL.
The BIG difference is that the VB function library is not depreciating.
Also, there is *no* direct alternative to these functions in the runtime
library. If you use ILDasm to see this implementation, you will notice that
these functions do a lot more than the Parse() methods available on double
and DateTime. VB's runtime library is a tremendous convenience. Who would
want to keep writing these functions over and over? And more to the point,
if you created your own library for them, it'd be no different.

-Rob Teixeira [MVP]

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I didn't remember exactly where it was and didn't bother to look it up. My
point was that it was in a DLL created specifically to make VB6 to VB.NET
transition easier.

"Armin Zingler" <az*******@freenet.de> wrote in message
news:en****************@TK2MSFTNGP11.phx.gbl...
"Cor" <no*@non.com> schrieb
Hi Armin,

Yes but that is not completly clear from your message.

You only say "sure ?" and not that they are normal in the

Microsoft.VisualBasic namespace


After writing "sure?" I think she will see where it actually is.
--
Armin


Nov 20 '05 #13

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

Similar topics

8
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...
8
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...
4
by: John A Grandy | last post by:
IsNumeric() and IsDate() are "leftovers" from the VB6 days ... looking forward, perhaps it would be better not to use them .... does anyone have suggestions on replacements ?
2
by: Oenone | last post by:
I'm having a couple of problems with the IsDate function in VB.net (.net framework v1.1). Having searched the web and usenet for others having the same problem, I've seen several posts from people...
19
by: MDC | last post by:
Why does this return true: IsDate("ISometimesHateProgrammingMarch2005") Is there another way to verify that this is not a date?? Thanks in advance! MDC
7
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...
5
by: Joris Zwaenepoel | last post by:
Hi all, I don't think a solution exists, but maybe there is some option in Visual Studio that I do not know about. When developping (or debugging), I like to set the "exceptions" option to...
12
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...
17
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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
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...
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.