Goran Bibic

Goran Bibic

  • 480
  • 2.9k
  • 200.7k

Read PDF doc to axAcroPDF c#

Jul 18 2018 2:35 PM
I need to read from ms sql file to adobe PDF reader
Error is line 8
 
Error CS0029 Cannot implicitly convert type 'System.IO.MemoryStream' to 'string'
 
Some help?
  1. try  
  2.                 {  
  3.                     if (documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value != null)  
  4.                     {  
  5.                         byte[] ap = (byte[])documentsDataGridView.SelectedRows[0].Cells["pdf_file"].Value;  
  6.                         MemoryStream ms = new MemoryStream(ap);  
  7.                        
  8.                         axAcroPDF1.src = ms;  
  9.   
  10.   
  11.                           
  12.                     }  
  13.                     else {  
  14.                         axAcroPDF1.src = null;  
  15.                     }  
  16.                 }  
  17.                 catch  
  18.                 {  
  19.                     axAcroPDF1.src = null;  
  20.                 } 
 

Answers (4)