public DataTable readdata(String sheetname, String filename) { OleDbConnection MyConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source='" + filename + "'; Extended Properties=Excel 8.0;"); OleDbDataAdapter MyCommand = new OleDbDataAdapter("select * from [" + sheetname + "]", MyConnection); DataTable dt = new DataTable(); MyCommand.Fill(dt); MyConnection.Close(); MyConnection.Dispose(); return dt; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)