473,569 Members | 2,879 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1054
* "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.TryPa rse' 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.TryPa rse' 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******** ******@tk2msftn gp13.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

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

Similar topics

2
5204
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 appreciated. TIA
4
5358
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 calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm...
2
4149
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 why it doesn't work? Thanks in advance Tjerk
9
2624
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 will work to clean the data, but I'm having trouble putting those rules into efficient SQL. The table that I'm dealing with has just under 9M rows...
30
3654
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 seems unnecessarily long. For some while, the following approach has been given here :- function ValidDate(y, m, d) { // m = 0..11 ; y m d...
3
2561
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, IT.itemid, IT.date,
1
2800
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 manual date selection to clear the start and end date to allow the end user input other days. I have taken into account our financial 1st and last day...
7
31805
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 current date. If not, I'd like to display the error message to ValidationSummary. It seems to make sense to me to use CompareValidator but the...
12
29435
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 follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
3
2344
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 ("d")+7, date("Y"))); else if ($close_date == 1)
0
7930
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. ...
0
8138
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...
0
7983
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...
0
6290
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...
0
5228
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...
0
3662
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...
1
2118
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
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
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...

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.