Hey i use linq to sql for store and retrive image from database ,i use varchar(max) datatype for it.
Here is my code for save image,
EventBL r = new EventBL();
r.Banner_SignUp_Page = System.IO.Path.GetFullPath(fuBanner.FileName);
r.Insert();
and here is for retrive it.
var result1 = from a in db.EMR_INVITATIONs
join b in db.EMR_EVENTs on a.EventID equals b.EventID
where b.EventID == (int)Session["eventid"]
select new
{
Banner = b.Banner_SignUp_Page,
};
var ev = result1.First();
Image1.ImageUrl = ev.Banner;
but in database i found that whole path of image isn't store .
in database some of the path is stored,and i can't retrive image from database
If there is solution or improvement in my code
Then please let me know,
Thanks in advaance.
Why whole imagepath is not store in database
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


venkata kumarRank #5,034 · 314 reputationPosted Dec 13, 2013, 1:55 AM EST
i think in db you need to increase length of the data type
ketan italiyaRank #4,305 · 352 reputationPosted Dec 13, 2013, 3:17 AM EST
i specify in my question.