Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting SQL Server uniqueidentifier to .NET Guid type
Message
From
24/03/2009 12:02:15
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
Database:
MS SQL Server
Miscellaneous
Thread ID:
01391015
Message ID:
01391051
Views:
37
>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/
Previous
Reply
Map
View

Click here to load this message in the networking platform