private DataSet getData(string Path) { string fileName = Path; string connectionString = @"Provider=Microsoft.ACE.OLEDB.14.0;Data Source="+fileName+";ExtendedProperties="+"Excel 12.0;HDR=YES;"; OleDbConnection con = new System.Data.OleDb.OleDbConnection(connectionString); con.Open(); OleDbDataAdapter cmd = new System.Data.OleDb.OleDbDataAdapter("select * from [SHEET1$]", con); DataSet excelDataSet = new DataSet(); cmd.Fill(excelDataSet); con.Close(); return excelDataSet; }
strExcelCon = @"Provider=Microsoft.ACE.OLEDB.14.0;Data Source=" + sExcelPath + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1'";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)