我正在使用 oleDbConnection 从 Oracle 列中选择一个 BLOB 数据,我必须坚持使用这种类型的连接,因为我的所有应用程序都在使用它。
使用以下代码后,出现错误:未指定的错误。
Dim pSelectCommand As OleDbCommand = New OleDbCommand()
Dim commandTextTemplate As String = "SELECT PICTURE FROM ALBUMS WHERE CODE= 4"
pSelectCommand.CommandText = commandTextTemplate
pSelectCommand.Connection = g_pOleDbConnection
Dim fs As FileStream
' Open the connection and read data into the DataReader.
If g_pOleDbConnection.State = ConnectionState.Closed Then g_pOleDbConnection.Open()
Dim myReader As OleDbDataReader = pSelectCommand.ExecuteReader() 'Error is on this line
Do While (myReader.Read())
Dim byteArray As Byte() = (myReader(g_pfldAPicture))
fs = New FileStream("Album.bmp", FileMode.CreateNew, FileAccess.Write)
fs.Write(byteArray, 0, byteArray.Length)
Loop
我可以尝试什么来解决这个问题?