OracleLob error
Posted: 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
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