Connecting Tech Pros Worldwide Forums | Help | Site Map

woking BLOBS with OLEDB

Newbie
 
Join Date: May 2007
Posts: 1
#1: May 13 '07
i have the code below but it gives the error: The data type is not verified. Do you know what is it? Do i need extra download instead of oracle 10g XE. i am using C# .Net 2003.



int PictureCol = 0;

OleDbConnection conn = new OleDbConnection("Provider=MSDAORA;Data Source=127.0.0.1;User ID=---;Password = ---");

OleDbCommand myCommand = new OleDbCommand("select photobrowse from mpho where username = 'tmac'",conn);

conn.Open();

OleDbDataReader dr = myCommand.ExecuteReader();
dr.Read();

Byte[] b = new Byte[(dr.GetBytes(PictureCol, 0, null, 0, int.MaxValue))];

dr.GetBytes(PictureCol, 0, b, 0, b.Length);
dr.Close();
conn.Close();

string DestFilePath = @"C:\lena2.bmp";
System.IO.FileStream fs = new System.IO.FileStream(DestFilePath, System.IO.FileMode.Create, System.IO.FileAccess.Write);
fs.Write(b, 0, b.Length);
fs.Close();

msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,886
#2: May 16 '07

re: woking BLOBS with OLEDB


You have posted your question in the Articles section. I am now moving it to the Oracle forum.

ADMIN
Reply