image not displaying in gridview

Posted by Parthibansk under ASP.NET on 11/25/2014 | Points: 10 | Views : 386 | Status : [Member] | Replies : 0
i am using asyncfile upload control to save image in database and fileuplaod control to save document file in db.
for both columns i specify varbinary(max) datatype..

on binding in gridview image not displaying, but stored in db not in relative path ~/photo..

protected void fileUploadSuccess(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)

string sd = System.IO.Path.GetFileName(AjaxSamplefileUpload.FileName);
AjaxSamplefileUpload.SaveAs(Server.MapPath("~/photo/") + sd);
string photo = "~/photo/" + sd;
//Image1.ImageUrl = "~/photo/" + filename;


cmd.Parameters.AddWithValue("@photo", bytes1);

image is storing in db in binary format, but not displaying...


(No response found.)

Login to post response