OleDbConnection connection = null; try { string excelConnectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 8.0;HDR=Yes'", path); connection = new OleDbConnection(); connection.ConnectionString = excelConnectionString; OleDbCommand command = new OleDbCommand("select * from [Sheet1$]", connection); connection.Open(); DbDataReader dr = command.ExecuteReader(); DataTable table = new DataTable("Customers"); table.Load(dr);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)