Beispiel #1
0
 private void dataGridView1Load()
 {
     try
     {
         ExcelOLEDB.ExcelVersion version = (ExcelOLEDB.ExcelVersion) this.comboBoxExcelVersion.SelectedValue;
         ExcelOLEDB datos   = new ExcelOLEDB(this.openFileDialog1.FileName, version);
         DataTable  valores = datos.readExcel();
         this.dataGridView1.DataSource    = valores;
         this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullColumnSelect;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error al leer Excel", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
 private void dataGridView1Load()
 {
     try
     {
         ExcelOLEDB.ExcelVersion version = (ExcelOLEDB.ExcelVersion)this.comboBoxExcelVersion.SelectedValue;
         ExcelOLEDB datos = new ExcelOLEDB(this.openFileDialog1.FileName, version);
         DataTable valores = datos.readExcel();
         this.dataGridView1.DataSource = valores;
         this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullColumnSelect;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error al leer Excel", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }