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

Date

How can I verify if a textbox that receives a date have or not a date??

Like IsDate vb6 function.....

Thank's
Nov 20 '05 #1
13 1044
* "André Almeida Maldonado" <de***@bol.com.br> scripsit:
How can I verify if a textbox that receives a date have or not a date??

Like IsDate vb6 function.....


'IsDate' still exists in VB.NET.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Thank's,

I know it, but it is not good to work with it... There is a class that can
do the same....
Thank's again...
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> escreveu na mensagem
news:br************@ID-208219.news.uni-berlin.de...
* "André Almeida Maldonado" <de***@bol.com.br> scripsit:
How can I verify if a textbox that receives a date have or not a date??

Like IsDate vb6 function.....


'IsDate' still exists in VB.NET.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
On Tue, 16 Dec 2003 15:28:44 -0200, André Almeida Maldonado wrote:
How can I verify if a textbox that receives a date have or not a date??

Like IsDate vb6 function.....

Thank's


You can also "roll your own" IsDate function like so (But IsDate may
already do this):

Public Function IsDate(d As String) As Boolean
Try
DateTime.Parse(d)
Return True
Catch ex As Exception
Return False
End Try
End Function
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #4
* "André Almeida Maldonado" <de***@bol.com.br> scripsit:
I know it, but it is not good to work with it... There is a class that can
do the same....


'DateTime.Parse'/'DateTime.TryParse' inside a 'Try...Catch' block.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
"André Almeida Maldonado" <de***@bol.com.br> schrieb
How can I verify if a textbox that receives a date have or not a
date??

Like IsDate vb6 function.....


Use VB.NET IsDate function.
--
Armin

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

Nov 20 '05 #6
Cor
Hi André Almeida Maldonado
I know it, but it is not good to work with it... There is a class that can

do the same...

Why?

Cor.
Nov 20 '05 #7
Cor
Hi Herfried

Same question to you (I never use IsDate) but I am curious
I know it, but it is not good to work with it... There is a class that
can do the same....

Why is this your opinion?
'DateTime.Parse'/'DateTime.TryParse' inside a 'Try...Catch' block.


Cor
Nov 20 '05 #8
You can do this:

Try
Dim datevar
datevar = cDate(inputVar)
Catch
msgbox("Error, must enter a date")
End Try

Sean
-----Original Message-----
How can I verify if a textbox that receives a date have or not a date??
Like IsDate vb6 function.....

Thank's
.

Nov 20 '05 #9
Cause nobody knows if these functions still working in the next versions of
the Framework....
"Cor" <no*@non.com> escreveu na mensagem
news:eZ**************@tk2msftngp13.phx.gbl...
Hi André Almeida Maldonado
I know it, but it is not good to work with it... There is a class that
can do the same...

Why?

Cor.

Nov 20 '05 #10
Cor
Hi Andre,
Cause nobody knows if these functions still working in the next versions of the Framework....


And you are sure that that is with all other classes for sure?

Please give me the link, I am curious?

Cor
Nov 20 '05 #11
"André Almeida Maldonado" <de***@bol.com.br> schrieb
Cause nobody knows if these functions still working in the next
versions of the Framework....


In addition to Cor,
the "MSVB.NET runtime" library is not the "MSVB.NET *compatibility*"
library.
--
Armin

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

Nov 20 '05 #12
Hi Cor,

* "Cor" <no*@non.com> scripsit:
Same question to you (I never use IsDate) but I am curious


Why don't you use 'IsDate'? What do you use instead?
I know it, but it is not good to work with it... There is a class that

can do the same....

Why is this your opinion?
'DateTime.Parse'/'DateTime.TryParse' inside a 'Try...Catch' block.


Sorry, I don't get the point.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13
Cor
Herfried,

In one of our arguing in the past I started accepting the Microsoft Visual
Basic words, because I did find it something rich from the language. I even
saw in a while in this newsgroup that in certain situations they are more
effective than the general system members. If necessary I will even use
them. (Although I have a big problem with the 1 start index and that is the
reason I avoid them).

But I think that it is good, when someone says I heard that it are not good
instructions, to act in the same way as Armin and I did in this thread.

And not give an answer. In this case I think I take Toms words: 'it is
better to learn someone how to fish than to give him a fish" (And then
adding my words if he not is starving).

Cor
I know it, but it is not good to work with it... There is a class
that can do the same....

Why is this your opinion?
'DateTime.Parse'/'DateTime.TryParse' inside a 'Try...Catch' block.


Sorry, I don't get the point.

Nov 20 '05 #14

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

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
2
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or...
9
by: Thomas R. Hummel | last post by:
Hello, I am importing data that lists rates for particular coverages for a particular period of time. Unfortunately, the data source isn't very clean. I've come up with some rules that I think...
30
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code...
3
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location,...
1
by: Liz Malcolm | last post by:
Hello and TIA. I have a DE form with an option group that if daily is selected todays date is used for start and end date, if weekly is selected Monday - Friday is used. I am trying to add a...
7
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
3
by: JJ | last post by:
Here's the code. $link="http://xbox360cheat.org"; $close_date=$_POST; #last content change check if ($close_date == 0) $close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date...
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
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,...
0
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...
0
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...
0
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...

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.