Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DefaultValue attribute
Message
 
 
À
27/05/2008 14:12:58
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01319742
Message ID:
01319746
Vues:
14
>How did you code that? You probably need to use typeof(DateTime) and a string value:
>
>
>[DefaultValue(typeof(DateTime), "5/27/08")]
>
>
>I'm not sure (because I haven't actually tried it), but you *might* be able to get away with this:
>
>
>[DefaultValue(typeof(DateTime), DateTime.Today.ToString())]
>
>
>~~Bonnie
>

The second version didn't work, but the first did. I was trying DefaultValue(DateTime.Today) and also was trying to use Convert class, but didn't think of adding typeof at the beginning.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform