Reading Excel Files with OLEDB

{copytext|code}
static void LoadExcelFile(string file, string sheet)
{
    // Use this connection string template for older (pre-2007) version of Excel
    //string s = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + file 
    //    + ";Extended Properties=Excel 8.0";

    // Use this connection string template for Excel 2007
    string s = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + file 
        + ";Extended Properties=\"Excel 12.0 Xml;HDR=YES\";";

    OleDbConnection conn = new OleDbConnection(s);
    OleDbDataAdapter da = new OleDbDataAdapter("select * from [" + sheet + "$]", conn);
    DataTable dt = new DataTable();
    da.Fill(dt);
}