zoukankan      html  css  js  c++  java
  • 读取excel

     string path = row["FileAddress"].ToString().Trim();
                            Stream fs;
                            try
                            {
                                fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
                            }
                            catch (Exception e)
                            {
                                writeImport("Y", null, null, "未找到该文件", row["FileID"].ToString().Trim(), "");
                                continue;
                            }
                            DataTable dtnew = new DataTable();
                            if (row["FileType"].ToString().Trim() == ".xls")
                            {
                                dtnew = Common.ExcelHelper.RenderDataTableFromExcel(fs);
                            }
                            else
                            {
                                dtnew = Common.ExcelHelper.RenderDataTableFromExcel2007(fs);
                            }
                            if (dtnew != null && dtnew.Rows.Count > 0)
                            {}

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

  • 相关阅读:
    nginx正则配置解释和fastadmin
    Centos7中systemctl命令详解
    layer的iframe层的传参和回参
    centOS下jenkins
    centos下nginx安装和配置
    python文件目录练习题【一】
    python正则模块re使用案例
    python字符串常用方法
    Swoole的多进程模块
    swoole学习
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/7606414.html
Copyright © 2011-2022 走看看