Arul Selvan

Arul Selvan

  • NA
  • 26
  • 52.1k

problem while retrive image from database

Feb 21 2011 5:45 AM
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¡Zd;§¦¥ïìçxy{™ššbhpÛ½ŒQ?3,&DCCÈ ‹lMŽcOîðñw\@ÞÝÚ†ƒ~d`]ÆÀ¸ÿÿÿ!ù,‹¸ÿÀŸpH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬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...





Answers (3)