Is there a way to get a column by name and retain the SQL type information returned by SqlDataReader
?
I only see .GetGuid(int column)
?
There is no separate method to get a GUID (or any of the other types) by column name directly.
What you need to do is this:
Guid someguid = dr.GetGuid(yourDataReader.GetOrdinal("your-col-name"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With