Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting string to date
Message
De
14/05/2006 09:50:33
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01121705
Message ID:
01121751
Vues:
18
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform