while retrieving image in byte format from SQL table it is previewing but encripted symbols are also showing @ top of my web page
rd.Read();
Session["id"] = rd["id"].ToString();
ccname.Text = rd["CustomerName"].ToString();
ffname.Text = rd["FathersName"].ToString();
ddob.Text = rd["Dob"].ToString();
ggender.Text = rd["Sex"].ToString();
ooccupation.Text = rd["Occupation"].ToString();
mmnumber.Text = rd["MobileNumber"].ToString();
almnumber.Text = rd["alternativemobilenumber"].ToString();
llnumber.Text = rd["LandLineNumber"].ToString();
pproof.Text = rd["IdProof"].ToString();
iidnum.Text = rd["IdNumber"].ToString();
aaddress.Text = rd["Address"].ToString();
ccity.Text = rd["City"].ToString();
rReference.Text = rd["Reference"].ToString();
rrefrelation.Text = rd["ReferenceRelationship"].ToString();
Context.Response.BinaryWrite((Byte[])rd[rd.GetOrdinal("Photo")]);
rd.Close();
i have tried this method to retrive my image from sql server with the help of store procedure but i could't find an solution is there any changes in my syntax pls give me some suggestion
byte[] bytes = ((byte[])rd["Photo"]);
string imageSource = string.Format("/CustomerImage.ashx?id={0}&id={1}", Session["id"], "{0}");
string strBase64 = Convert.ToBase64String(bytes);
photo.ImageUrl = string.Format(imageSource, strBase64);
con.Close();