Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting string to date
Message
From
14/05/2006 09:50:33
 
 
To
13/05/2006 18:07:03
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01121705
Message ID:
01121751
Views:
14
Try using the DateTime.Parse() method instead. See if that helps.

~~Bonnie



>I have the following code
>
>if(CDate(DtpCCValidUpto.text)<Now()) Then
>   MessageBox.Show ("Invalid date.")
>   DtpCCValidUpto.Focus()
>   Return
>endif
>
>i ran the program and in a form enter the date in a DateTimePicker
>and the following message appears
>
>No controled Exception 'System.InvalidCast.Exception' in microsoft.visualbasic.dll
>Aditional Information: "The convertion of the string 04/22/2006" to Date is not Vaild
>
>
>How can i solve that?
>Thank you
>Luis Martin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform