title: Load Byte array to pdf in adobe reader component in windows application
body: <p>I have a pdf file , in admin all the pdf files are converted into byte array stored in database.</p>
  
  <pre><code>public void Getfile()
  {
      byte[] file;
      string varFilePath = @"D:\PDFConvertion\pdf\100CountryHouses.pdf";
      try 
      {
          using (var stream = new FileStream(varFilePath, FileMode.Open, FileAccess.Read))
          {
              using (var reader = new BinaryReader(stream))
              {
                  file = reader.ReadBytes((int)stream.Length);
              }
          }
          SqlConnection sqlCon;
          sqlCon = new SqlConnection("server details");               
          sqlCon.Open();
          using (var sqlWrite = new SqlCommand("INSERT INTO pdftest Values(@File)", sqlCon))
          {
              sqlWrite.Parameters.Add("@File", SqlDbType.VarBinary, file.Length).Value = file;
              sqlWrite.ExecuteNonQuery();
          }
          sqlCon.Close();
          MessageBox.Show("Converted Success - Length " + Convert.ToString(file.Length));
      }
      catch (Exception Ex)
      {
          throw Ex;
      }   
  }
  </code></pre>
  
  <p>Once file has been uploaded user has view the file , i have used adobe reader component to load the pdf file .</p>
  
  <pre><code>        private void button1_Click(object sender, EventArgs e)
          {
              string varPathToNewLocation = @"D:\PDFConvertion\converted\test.pdf";
              try
              {
                  SqlConnection sqlCon;
                  sqlCon = new SqlConnection("");
                  sqlCon.Open();
                  using (var sqlQuery = new SqlCommand(@"SELECT test FROM [dbo].[pdftest] ", sqlCon))
                  {
  
                      using (var sqlQueryResult = sqlQuery.ExecuteReader())
                          if (sqlQueryResult != null)
                          {
                              sqlQueryResult.Read();
                              var blob = new Byte[(sqlQueryResult.GetBytes(0, 0, null, 0, int.MaxValue))];
                              sqlQueryResult.GetBytes(0, 0, blob, 0, blob.Length);
                              using (var fs = new FileStream(varPathToNewLocation, FileMode.Create, FileAccess.Write))
                                  fs.Write(blob, 0, blob.Length);
                          }
                  }
                  sqlCon.Close();
                  axAcroPDF1.LoadFile(@"D:PDFConvertion\converted\test.pdf");
  
              }
              catch (Exception Ex)
              {
                  throw Ex;
              }
          }
  </code></pre>
  
  <p>But i want to load the file in adobe reader component directly without storing in location.</p>