Page 1 of 1

OracleLob error

Posted: Fri 14 Aug 2015 07:32
by ths
Hello,
according to the documentation from DevArt we can get BLOB field from Oracle using the following sample code:

OracleCommand myCommand = new OracleCommand("SELECT * FROM Pictures", myConnection);
myConnection.Open();
OracleDataReader myReader = myCommand.ExecuteReader(System.Data.CommandBehavior.Default);
try
{
while (myReader.Read())
{
IF (myReader["Picture"] != DBNull.Value) <-- this part makes problem !!!
{
OracleLob myLob = myReader.GetOracleLob(myReader.GetOrdinal("Picture"));
....

However, doing this I get "The object of type System.Byte[] cannot be cast into Devart.Data.Oracle.OracleLob" error (translated from German) on the last line above.
What is wrong here?
Thanks,
Vladimir

Re: OracleLob error

Posted: Tue 18 Aug 2015 13:56
by Shalex
Thank you for your report. We have reproduced the issue and are investigating it.

As a workaround, please use

Code: Select all

if (!myReader.IsDBNull("Picture"))
instead of

Code: Select all

if (myReader["Picture"] != DBNull.Value)

Re: OracleLob error

Posted: Thu 20 Aug 2015 16:42
by Shalex
The bug is fixed in the newest (8.5.478) build of dotConnect for Oracle.