OracleLob error

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
ths
Posts: 53
Joined: Thu 29 Dec 2011 16:18

OracleLob error

Post by ths » Fri 14 Aug 2015 07:32

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

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: OracleLob error

Post by Shalex » Tue 18 Aug 2015 13:56

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)

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: OracleLob error

Post by Shalex » Thu 20 Aug 2015 16:42

The bug is fixed in the newest (8.5.478) build of dotConnect for Oracle.

Post Reply