using (OleDbCommand cmd = new OleDbCommand("SELECT * FROM [" + sheetName + "]", conn)) { using (OleDbDataAdapter da = new OleDbDataAdapter()) { da.SelectCommand = cmd; try { da.Fill(dt); dt.TableName = sheetName.Replace("$", ""); } catch (Exception ex) { ErrSheetName = ErrSheetName + "," + sheetName.Replace("$", ""); } } }
cmdExcel.CommandText = "SELECT * From [" + SheetName + "A3:B5]"; da.SelectCommand = cmdExcel; da.Fill(ds); connExcel.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)