参照这个格式撒:       
 string ConnStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Book3.xls;Extended Properties='Excel 8.0'";

解决方案 »

  1.   

    string ConnStr ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Book3.xls;Extended Properties='Excel 8.0'";
            string query = "SELECT * FROM [Sheet1$]";
            OleDbConnection odction = new OleDbConnection(ConnStr);
            OleDbCommand oleCommand = new OleDbCommand(query, odction);
            OleDbDataAdapter oleAdapter = new OleDbDataAdapter(oleCommand);
            DataSet myDataSet = new DataSet();
            oleAdapter.Fill(myDataSet, "[Sheet1$]");