Hi i stored image in database,i use these coding for bind a image in image control,
DL.OpenConnection();
SqlDataAdapter
DataSet
da.Fill(ds);
DataRow dr = ds.Tables[0].Rows[0];
byte[] bytes = (byte[])dr["Category_Image"];
Response.OutputStream.Write(bytes, 0, bytes.Length);
Response.End();
DL.CloseConnection();
this coding work correctly i already used another one application, it give output in web page
O÷öôRTZ¡Zd;§¦¥ïìçxy{™ššbhpÛ½ŒQ?3,&DCCÈ ‹lMŽcOîðñw\@ÞÝÚ†ƒ~d`]ÆÀ¸ÿÿÿ!ù,‹¸ÿÀŸpH,ȤrÉl:ŸÐ¨tJZ¯Ø¬vËíz¿à°ø˜ò) è4ZÁf›¾¸ÏÐR«Ûò~?Øõw€€)c‡G qm"igh™š™œŸ
like this binary values...
but this same coding i am used another one my web application it not give the correct output.it gives on page
System.Byte[]
what is the problem?
i used in this web application both c# and VB languages...
Loading

Arul SelvanPosted Feb 23, 2011, 10:38 AM
server side coding:
ImageHandler.ashx coding:
hi this same coding i used another one application its work
but now it not working whats the problem,
Arul SelvanPosted Feb 23, 2011, 10:29 AM
dinamically
above coding worked another one application.
but now i am using But give output System.Byte[]
its not read binary values from database... whats the problem
i used in this application both c# and Vb
Amit ChoudharyPosted Feb 22, 2011, 2:59 AM
You need to specify the output stream type while sending it to the client.
for e.g.,
Image oImg = Image.FromFile(sPath + @"\images\" + sFileName,true);
oImg.Save(oContext.Response.OutputStream,ImageFormat.Jpeg);
Thanks.