asp.net读取excel2007

          string file1 = "F:\\bidui\\q.xlsx";
           OleDbConnection olecon = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + file1 + ";Extended Properties='Excel 8.0;Hdr=No;IMEX=1'");
        olecon.Open();
        OleDbDataAdapter oledbda = new OleDbDataAdapter("select  * from [qq$]", olecon);
        DataSet myds = new DataSet();
        oledbda.Fill(myds);
        DataTable dt1 = myds.Tables[0];
 
 
 

你可能感兴趣的:(Excel,asp.net)