heres 2025, and i have the same problem when reading blob in old db with Oracle Managed Data Access Client. core 23 or any other vers, within .net core.
hard to solve, but by telling ai "read blob from oracle without using oracledatareader", answer comes, and it does work.
////connection prepared
string sql = @"
DECLARE
l_blob BLOB;
BEGIN
select blob_field into l_blob
from your_table_name
where id = :id;
:BlobData:= l_blob;
END;";
using (var transaction = conn.BeginTransaction())
{
try
{
//reading config
var getBlobCmd = new OracleCommand(sql, conn);
getBlobCmd.Parameters.Add(new OracleParameter("id", id));
var blobParam = new OracleParameter("BlobData", OracleDbType.Blob)
{
Direction = ParameterDirection.Output
};
getBlobCmd.Parameters.Add(blobParam);
//read
getBlobCmd.ExecuteNonQuery();
//gets blob value here
var oracleBlob = blobParam.Value as OracleBlob;
if (oracleBlob == null || oracleBlob.Length == 0)
throw new InvalidOperationException("blob length is 0");
transaction.Commit();
}
catch (Exception)
{
transaction.Rollback();
throw;
}
}