Hi
I am doing image insert to db and retrieve them. I am inserted byte for images
like this
My Insert Code
int length = FupImage.PostedFile.ContentLength;
byte[] imgbyte = new byte[length];
HttpPostedFile img = FupImage.PostedFile;
img.InputStream.Read(imgbyte, 0, length);
cmd.Parameters.Add(new SqlParameter("@StdImagePath", SqlDbType.Image)).Value = imgbyte;
How to populated the image field
my code below but did not bind them plz change the code but this is not working
===========================================================
SqlCommand command = new SqlCommand("select StdImagePath from Tbl_StudentsProfile where StudentID=" + autoID +"", con);
SqlDataReader dr = command.ExecuteReader();
dr.Read();
Context.Response.BinaryWrite((Byte[])dr[0]);
Mark as Answer if its helpful to you
Kumaraspcode2009@gmail.com