Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cast vs .ToString()
Message
De
15/12/2003 14:26:25
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Cast vs .ToString()
Divers
Thread ID:
00859235
Message ID:
00859235
Vues:
65
Anybody know off-hand which is faster (or does it really matter <g>)? I would think that the cast would be faster, or better, but I don't really know.
string x = row["MyColumn"].ToString();
or
string x = (string)row["MyColumn"];
This is assuming that you already know that row["MyColumn"] cannot be DBNull.Value.

TIA,
~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform