lretorno.Load(...)がデータを読み取るために何をしているのかわかりませんが、selectステートメントを使用したこのsudoコードサンプルが役立つかもしれません...私は常にblobを具体的に取得して読み取る必要がありました過去のバイトを取得します。
LONG RAWを取得する例 DataType
var imgCmd = new OracleCommand("SELECT photo FROM photos WHERE photo_id = 1", _con);
imgCmd.InitialLONGFetchSize = -1; // Retrieve the entire image during select instead of possible two round trips to DB
var reader = imgCmd.ExecuteReader();
if (reader.Read()) {
// Fetch the LONG RAW
OracleBinary imgBinary = reader.GetOracleBinary(0);
// Get the bytes from the binary obj
byte[] imgBytes = imgBinary.IsNull ? null : imgBinary.Value;
}
reader.Close();
BLOBを取得する例 DataType
var imgCmd = new OracleCommand("SELECT photo FROM photos WHERE photo_id = 1", _con);
var reader = imgCmd.ExecuteReader();
if (reader.Read()) {
// Fetch the blob
OracleBlob imgBlob = reader.GetOracleBlob(0);
// Create byte array to read the blob into
byte[] imgBytes = new byte[imgBlob.Length];
// Read the blob into the byte array
imgBlob.Read(imgBytes, 0, imgBlob.Length);
}
reader.Close();