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..


     

  • 相关阅读:
    学习进度02
    dataX windows10安装
    架构漫谈 阅读笔记03
    质量属性及战术
    架构漫谈 阅读笔记02
    2020.12.12收获
    2020.12.11收获
    2020.12.10收获
    2020.12.9收获
    2020.12.8收获
  • 原文地址:https://www.cnblogs.com/mikelij/p/1779871.html
Copyright © 2011-2022 走看看