title: relative path of image to byte array in C#
body: <p>i have relative path of an image as </p>
  
  <pre><code>~/image/noimage.jpg
  </code></pre>
  
  <p>i wants to read byte array to save in database if that organization's logo is not in db</p>
  
  <pre><code>public byte[] org_logo(int myOrgId)
      {
          byte[] photo ;
          var context = new mp_repositoryEntities();
          var query = from o in context.organizations 
                      where o.organization_id == myOrgId
                      select o.logo;            
          photo = query.FirstOrDefault&lt;byte[]&gt;();
          if (photo == null)
          {
              photo = File.ReadAllBytes("~/image/noimage.jpg");
          }
          return photo;
      }
  </code></pre>
  
  <p>when i am setting this path to asp image control then it is working fine.</p>
  
  <pre><code>logo.ImageUrl = "~/image/noimage.jpg";
  </code></pre>
  
  <p>any idea ?????</p>