Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Different Type Conversion Methods
Message
De
18/04/2007 12:58:44
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
À
18/04/2007 12:33:10
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB.NET 1.1
Divers
Thread ID:
01217261
Message ID:
01217378
Vues:
9
No I think is 2.0 only.

>I don't think the TryCast function is available in 1.1, is it?
>
>
>>but I will think they will generate the same IL code, but never checked, I use the CINT(), CDATE() and all the other C functions instead of convert, but that just cause I got use to.
>>I know that they say that DirecCast can yeld better performance then CTYPE funtion when converting from and to objects.
>>you know that you have also a TryCast function that what it does is instead of raising an error if the conversion can't be perform it returns nothing instead can be usefull is some case when you want to return nothing if a conversion can't be perform.
>>
>>>So do you know any advantages of using one over another, besides the exclusivity to VB (I did not know that, thanks).
>>>
>>>>Mike all the C...() are functions that only exist in VB.NET, the others .ToString or Convert are objects and methods of the .net framework that are available to every .net language.
>>>>
>>>>
>>>>>I have been meaning to ask this question for a while...
>>>>>
>>>>>What is the difference between different type conversion methods? For example:
>>>>>
>>>>>.ToString vs. CSTR() vs. Convert.ToString
>>>>>
>>>>>CDEC() vs. Convert.ToDecimal
>>>>>
>>>>>Date.Parse() vs. CDATE() vs. Convert.ToDateTime
>>>>>
>>>>>And a side question: Is there a difference between Date and DateTime types?
Alexandre Palma
Senior Application Architect
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform