Click here to Skip to main content
15,905,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings,

I`m using oleDbConnection in order to Select a BLOB data from Oracle column, and I have to stick with this type of connection since all my application is using it.

After I used the following code, I got the error: unspecified error..


VB
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



Please advise..
Thank you...
Posted

Oracle Blobs are not supported[^] by OleDb.
You have to use ADO.net instead.
 
Share this answer
 
Comments
dgthecodeproject 19-Apr-12 1:18am    
I think there is some ambiguous issue in the statement: "Oracle Blobs are not supported[^] by OleDb" because I already used this type to insert into BLOB oracle column and it succeed....So what I`m facing is only the select/read from this BLOB column through OLE object (OledbDataReader)...
Jörgen Andersson 20-Apr-12 16:07pm    
It's not me saying it's not supported, it's Microsoft.
Follow the link.
 
Share this answer
 
Comments
dgthecodeproject 18-Apr-12 9:36am    
Hello Prasad...

I already checked those links in your post before I post here...

maybe you didn`t get me very well. I already checked the oracle connection type and it was successful retrieving the BLOB data from Oracle column but the issue here is why I got an error (Unspecifed error) when I use OledbConnection type which is mandatory in my case...thats why I need help...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900