zoukankan      html  css  js  c++  java
  • 用OleDB读Excel文件

            string strCon;
            strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("excel.xls") + "; Extended Properties=Excel 8.0;";
            OleDbConnection olecon = new OleDbConnection(strCon);
            OleDbDataAdapter myda = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", strCon);
            DataSet myds = new DataSet();
            myda.Fill(myds);
            return myds;

    注意:

        .net 的进程impersonate用户须对

    Tried changing the permissions on:

    C:\Documents and Settings\<machine name >\ASPNET\Local Settings\Temp

    to include

    IUSER_MACHINENAME

    IWAM_MACHINENAME

    ASPNET already has full rights..

    Fixed by adding impersonate=true to web.config and setting adding ASPNET on c:\windows\temp directory (win2k3)  to FULL RIGHTS..


     

  • 相关阅读:
    Day 38
    Day 37
    Day 36
    Day 35
    Day 34
    Day 33
    Day 32
    Day 31
    Day 30
    华为CE6180高级ACL配置
  • 原文地址:https://www.cnblogs.com/mikelij/p/1779871.html
Copyright © 2011-2022 走看看