title: Best way to store image in database in linq to sql
body: <p>Can any one guide which will be the best way to store images to the database? I am using Sql server 2008. Currently I am storing file path in database but when I am trying to fetch it, it is not fetched.</p>
  
  <p>Here is code to save image:</p>
  
  <pre><code>string Extention = System.IO.Path.GetExtension(fuBanner.FileName);
  if (Extention == ".jpg" || Extention == ".jpeg" || Extention == ".bmp" || Extention == ".PNG")
   {
      result.Banner_SignUp_Page = System.IO.Path.GetExtension(fuBanner.FileName);
      db.SubmitChanges();
      lblMsg.Visible = true;
      Response.Redirect("ListOfEvent.aspx");
      //lblMsg.Text = "Records updated successfully.";
   }
  </code></pre>
  
  <p>And code for fetching the image:</p>
  
  <pre><code>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,
                      Title = b.Title  
                   };
  </code></pre>