string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;""", filepath.Text); string query = "select * from ["+cmbsheet.Text.Trim()+"$]"; OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString); DataSet dataSet = new DataSet(); dataAdapter.Fill(dataSet); dataGridView1.DataSource = dataSet.Tables[0];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)