How to check if a field is an Image field
Posted
by AJ
on Stack Overflow
See other posts from Stack Overflow
or by AJ
Published on 2010-04-12T14:20:16Z
Indexed on
2010/04/12
14:23 UTC
Read the original article
Hit count: 442
Hello,
This might seem an easy question for some, but I am struggling with it.
I am trying to use SQLDataReader.GetFieldType to check if a certain field is an Image field. Lets assume the first field of the result set is an Image field, if I do:
reader.GetFieldType(0).ToString;
I get System.Byte[]
But is this the correct way to check for it? I really don't like:
if (reader.GetFieldType(0).ToString="System.Byte[]")
Is there a better way?
Thanks,
AJ
© Stack Overflow or respective owner