tags:

views:

81

answers:

1

why My idatareader make error .....?

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

I want to retrive image from database here sFieldName is database column Name......it show me Specified cast is not valid. message ......what i do?work on c# window vs05....

sFieldName is a string ....it's the column name of database and column type is image My database column name is "BoardImage"

sFieldName="BoardImage"

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

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

A: 

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

Please update the missing info on database system, table structure, select statement.

devio