Connecting Tech Pros Worldwide Forums | Help | Site Map

Which will be faster?

Newbie
 
Join Date: Aug 2009
Posts: 5
#1: 3 Weeks Ago
Hi There

I am new to c#. I am using SqlDataReader to read database records(using c#).I have found lots of way to do it,but for performance i have found that ordinal reading is fast. Now I want to read a guid field ,as we know that with ordinal reading we can do this in two way
1)reader.GetGuid(0)
2) (Guid)reader[0]

but I don't know which will be faster...

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: 3 Weeks Ago

re: Which will be faster?


What happens if the field is null?
Reply