The problem with idatareader

why is my idatareader making a mistake .....?

 byteSize = _reader.GetBytes(_reader.GetOrdinal(sFieldName), 0, null, 0, 0);

      

I want to get an image from the database here sFieldName is the database column. Name ...... it shows me The order specified is invalid. message ...... what am I doing? working on c # window vs05 ....

sFieldName is a string ... this is the name of the database column and the type of the column image The name of the database column "BoardImage"

sFieldName = "BoardImage"

 oBoardDetail.BoardImage =oReader.GetImage("BoardImage");

      

here oBoardDetail is a class object and BoardImage is a property type of the Image class

0


a source to share


1 answer


Most likely the sFieldname column is not an Image or VarBinary column.



Update missing information about database system, table structure, select statement.

0


a source







All Articles