OracleLob error

OracleLob error

Postby 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
ths
 
Posts: 53
Joined: Thu 29 Dec 2011 16:18

Re: OracleLob error

Postby 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
Devart Team
 
Posts: 7542
Joined: Thu 14 Aug 2008 12:44

Re: OracleLob error

Postby Shalex » Thu 20 Aug 2015 16:42

The bug is fixed in the newest (8.5.478) build of dotConnect for Oracle.
Shalex
Devart Team
 
Posts: 7542
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle