我从oracle中提取BLOB。我已经通过应用程序完成了这个没有问题。但是在这个电话中我收到了一个错误。然而有趣的是,一旦我关闭错误,图像加载就好了。
Dim Conn As OleDb.OleDbConnection = New OleDbConnection(Private)
Conn.Open()
Dim mySelectQuery As String = "Select IMAGE,IMAGE_NAME,SIZE_BYTES from MPCS.IMAGE_RESOURCE WHERE IR_ID ='" & irid & "'"
Dim CMD As OleDbCommand = New OleDbCommand(mySelectQuery, Conn)
Dim Myreader As OleDbDataReader
Myreader = CMD.ExecuteReader()
Myreader.Read()
Dim Allbytes As Byte() = Myreader("IMAGE")
Using memory As MemoryStream = New MemoryStream(Allbytes)
Dim newimage = New Bitmap(memory)
PictureBox1.Image = newimage
End Using
奇怪的是,它不会发生在我选择拉动图像的其他项目上。我逐行调试每一个调试,比较一个错误和一个不错,每行都有正确的数据。