Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting SQL Server uniqueidentifier to .NET Guid type
Message
De
24/03/2009 12:02:15
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
Database:
MS SQL Server
Divers
Thread ID:
01391015
Message ID:
01391051
Vues:
38
>I have been using the casting (like in your 2nd example), I don't have any hard proof but I think it is more efficient.
>I was not aware of the reader.GetGuid, so that was an eye opener to me too. I'll have to check into that. Thanks for posting the code.

I read an article about casting vs. converting and the author said converting is more forgiving if you're converting bit types to integers. I don't do that and didn't need the extra flexibility, so I would have used casting had I not found the DataReader methods.
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform