ketan italiya

ketan italiya

  • NA
  • 353
  • 24.7k

Why whole imagepath is not store in database

Dec 13 2013 5:54 AM
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.


Answers (2)