Re: Unable to read BLOB objects through ADO.NET
neerajb_at_noida.nospamhcltech.com
Date: 02/09/05
- Next message: Forch: "SQL Server "Print" statement"
- Previous message: Janaka: "DEFAULT value in SqlParameter"
- In reply to: Paul Clement: "Re: Unable to read BLOB objects through ADO.NET"
- Next in thread: neerajb_at_noida.nospamhcltech.com: "Re: Unable to read BLOB objects through ADO.NET"
- Reply: neerajb_at_noida.nospamhcltech.com: "Re: Unable to read BLOB objects through ADO.NET"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Feb 2005 10:09:05 -0800
I am using following code for retreival of Blob Data.
Using this code I am getting the DOCfile saves on the Disc.
It's size also matches with the original document.
But when i open that file it gives me the following message:
"Microsoft Word can't import the specified format.An Error occured andthis
feature no more functioning properly.Please Contact your System
Administrator."
It seems that code is working properly and retreiving the BLOB object also
from the Oracle but either there is problem with Filestream Object in writing
the byte array to file or may be somethign else..
Please help...
OracleLob blob = oraImgReader.GetOracleLob(1);
// Create a byte array of the size of the Blob obtained
Byte[] b = new Byte[blob.Length];
// Read blob data into byte array
int i = blob.Read(b,0,System.Convert.ToInt32(blob.Length));
System.IO.FileStream fs =new System.IO.FileStream("C:\\test25.doc",
System.IO.FileMode.Create, System.IO.FileAccess.Write);
fs.Write(b, 0, b.Length);
fs.Close();
"Paul Clement" wrote:
> On Tue, 8 Feb 2005 21:41:02 -0800, "neerajb@noida.nospamhcltech.com"
> <neerajbnoidanospamhcltechcom@discussions.microsoft.com> wrote:
>
> ¤
> ¤
> ¤ "Paul Clement" wrote:
> ¤
> ¤ > On Sun, 6 Feb 2005 21:21:02 -0800, "neerajb@noida.nospamhcltech.com"
> ¤ > <neerajbnoidanospamhcltechcom@discussions.microsoft.com> wrote:
> ¤ >
> ¤ > ¤ Hi,
> ¤ > ¤
> ¤ > ¤ I need the help deperately.
> ¤ > ¤
> ¤ > ¤ My requirement is that i have to retrieve BLOB object from the Oracle and
> ¤ > ¤ need to save it on the Hard Disk through ADO.NET.
> ¤ > ¤
> ¤ > ¤ For this purpose i have tried it with OLEDB.NET Data provider and also
> ¤ > ¤ through the oracle client.
> ¤ > ¤
> ¤ > ¤ As i know that BLOB object contains Microsoft Word Document i am saving it
> ¤ > ¤ through Filestream object.
> ¤ > ¤
> ¤ >
> ¤ > See if the following helps:
> ¤ >
> ¤ > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadonet/html/advoracledataaccess.asp
> ¤ >
> ¤ >
> ¤ > Paul ~~~ pclement@ameritech.net
> ¤ > Microsoft MVP (Visual Basic)
> ¤ >
> ¤
> ¤
> ¤
> ¤ Hi Paul,
> ¤
> ¤ Thanks for the reply.
> ¤
> ¤ In the MSDN article it mentions the way to retreive the BLOB object which
> ¤ you can see in my code also.
> ¤
> ¤ Problem is that the Doc file which i am saving through FileStream is not
> ¤ opening in the Word 2000 properly and it gives the message that word is
> ¤ unable to read the specified format and it shows some junk characters in the
> ¤ file although it's no. of pages as well as size matches the original document.
> ¤
>
> How was the document saved to the database? Have you been able to use another other method to
> retrieve it (such as ADO)?
>
>
> Paul ~~~ pclement@ameritech.net
> Microsoft MVP (Visual Basic)
>
- Next message: Forch: "SQL Server "Print" statement"
- Previous message: Janaka: "DEFAULT value in SqlParameter"
- In reply to: Paul Clement: "Re: Unable to read BLOB objects through ADO.NET"
- Next in thread: neerajb_at_noida.nospamhcltech.com: "Re: Unable to read BLOB objects through ADO.NET"
- Reply: neerajb_at_noida.nospamhcltech.com: "Re: Unable to read BLOB objects through ADO.NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|