Fernando Calabro

Fernando Calabro

  • NA
  • 33
  • 1.8k

Upload PDF to AxacroPDF from Mysql

Aug 20 2020 8:50 PM
Goodnight everyone. Hope you can help me ... I made a C # software with a MySql database. In one of the tables I must save a PDF document in each record. Set that column as LONGBLOB. What I need to know is how to do so that when I choose an already saved record from the datagrid, the corresponding PDF is automatically loaded into the axacroPDF without having to download the file to the PC. I did a test but it throws me 2 errors and it doesn't work. I leave my code. MILLIONS OF THANKS !!!
  1. private void datagridpagos_CellContentClick(object sender, DataGridViewCellEventArgs e) {  
  2.   try {  
  3.     Pagos Form_Pagos = new Pagos();  
  4.     DataGridViewRow Volcado_Pagos = datagridpagos.Rows[e.RowIndex]; {  
  5.       foreach(Form frm1 in Application.OpenForms)  
  6.       if (frm1.Name == "Pagos") {  
  7.         Form_Pagos = (Pagos) frm1;  
  8.         Form_Pagos.txtboxproveedor.Text = datagridpagos.CurrentRow.Cells[1].Value.ToString();  
  9.         Form_Pagos.txtfechapago.Text = datagridpagos.CurrentRow.Cells[2].Value.ToString();  
  10.         Form_Pagos.txtmodalidad.Text = datagridpagos.CurrentRow.Cells[3].Value.ToString();  
  11.         Form_Pagos.txtimportepagado.Text = datagridpagos.CurrentRow.Cells[4].Value.ToString();  
  12.         Form_Pagos.VisorPDF.src = datagridpagos.CurrentRow.Cells[5].Value.ToString();  
  13.         this.Close();  
  14.         break;  
  15.       }  
  16.     }  
  17.   }  
  18.   catch(Exception ex) {  
  19.     MessageBox.Show(ex.Message);  
  20.   }  
  21. }

Answers (2)