Re: size problem with ole object data type (blob) and ado.net
From: Trent Millar (thm101_at_hotmail.com)
Date: 04/28/04
- Next message: Donald Adams: "Exception problems between languages"
- Previous message: Navin Mishra: "Re: Sending keys to an appl. window"
- In reply to: Pierre-Benoit: "size problem with ole object data type (blob) and ado.net"
- Next in thread: quertonp_at_hotmail.com: "Re: size problem with ole object data type (blob) and ado.net"
- Reply: quertonp_at_hotmail.com: "Re: size problem with ole object data type (blob) and ado.net"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 03:39:48 GMT
I know with some older image formats you must actually run ahead of some of
the old header input. For instance when using the Northwind database you
would have to edit your code below to this:
byte[] blob = (byte[]) (ds.Tables["employees"].Rows[0]["photo"]);
_stream.Write (blob, 78, blob.Length -78); // hack's out the old header info
_bitmap = new Bitmap (stream);
If you're certain that the images are there you should look into this as a
likely solution.
rgds,
Trent Millar
"Pierre-Benoit" <quertonp@hotmail.com> wrote in message
news:ccda81a5.0404270717.6020adb0@posting.google.com...
> Hi there,
>
> I've a strange problem with ado.net and an Access db. I need to create
> a little C# app that take the content of "ole object" field and then
> save it into a file.
>
> The problem is that when I do the following
>
> Byte[] byteBLOBData = new Byte[0];
> byteBLOBData = (Byte[])(ds.Tables["tblRefAlbum"].Rows[0]["photo"]);
>
> I get the exact double of the original size! and if I save this array
> byte to a file I'll get my file with every two byte set to 00.
>
> The result is, of course, not an image. I've tryed to manipulate my
> array of byte to strip every two bytes but the result is an visible
> image but not the correct image (it's a scrambled image that appears).
>
> Please help, I really need to do this exportation of picture in .net
> with the access db.
>
>
> Thanks a lot for people whom can help me.
- Next message: Donald Adams: "Exception problems between languages"
- Previous message: Navin Mishra: "Re: Sending keys to an appl. window"
- In reply to: Pierre-Benoit: "size problem with ole object data type (blob) and ado.net"
- Next in thread: quertonp_at_hotmail.com: "Re: size problem with ole object data type (blob) and ado.net"
- Reply: quertonp_at_hotmail.com: "Re: size problem with ole object data type (blob) and ado.net"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|