OleDB Image
-
Please, anybody, I need to display an image from an access database. Can you show me how? I can't seem to get any of the example I've found to work
Oh come on guys, do I ask that much? I'm sure you know, it's not hard, it's just that I get a picture that "cannot be displayed" and when I look inside (with mozilla) I see /���� ���!�ÿÿÿÿBitmap Image�Paint.Picture���������PBrush����������Õ�BMöÔ�� and more stuff just like that. What am I doing wrong? OleDbCommand command=new OleDbCommand("SELECT imagine FROM produse WHERE produse.cod_produs=10",dbconn); Byte[] imagedata=(byte[])(command.ExecuteScalar()); Response.ContentType = "image/bmp"; Response.BinaryWrite(imagedata); :((
-
Oh come on guys, do I ask that much? I'm sure you know, it's not hard, it's just that I get a picture that "cannot be displayed" and when I look inside (with mozilla) I see /���� ���!�ÿÿÿÿBitmap Image�Paint.Picture���������PBrush����������Õ�BMöÔ�� and more stuff just like that. What am I doing wrong? OleDbCommand command=new OleDbCommand("SELECT imagine FROM produse WHERE produse.cod_produs=10",dbconn); Byte[] imagedata=(byte[])(command.ExecuteScalar()); Response.ContentType = "image/bmp"; Response.BinaryWrite(imagedata); :((
nc3b wrote:
Oh come on guys, do I ask that much?
A bit patience perhaps? If you want 24/7 support with immediate response, you have to pay for it...
nc3b wrote:
Response.ContentType = "image/bmp"; Response.BinaryWrite(imagedata);
Is it a bmp file that you have stored in the field?
--- single minded; short sighted; long gone;
-
nc3b wrote:
Oh come on guys, do I ask that much?
A bit patience perhaps? If you want 24/7 support with immediate response, you have to pay for it...
nc3b wrote:
Response.ContentType = "image/bmp"; Response.BinaryWrite(imagedata);
Is it a bmp file that you have stored in the field?
--- single minded; short sighted; long gone;
-
Make sure that there is no markup in the page that gets sent along with the image data, only the @Page tag.
--- single minded; short sighted; long gone;
-
Make sure that there is no markup in the page that gets sent along with the image data, only the @Page tag.
--- single minded; short sighted; long gone;
-
I looked into the source again and I tried Response.OutputStream.Write(imagedata,78,1000); But now mozilla doesn't say the immage cannot be displayed, it just doesn't print it.
I did it. Just omit the first 78 bytes from the file. After this wonderful solution, I believe I won't let anyone persuade me again into writing aspx. Why I don't like aspx.