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)
                            {}

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

  • 相关阅读:
    php解析XML的两种方法
    Windows下xampp搭配php环境以及mysql的设置和php连接Mysql数据库
    管道
    Ubuntu文件系统
    Ubuntu如何使用Vscode写C++代码
    Ubuntu如何百度云盘下载
    Debug程序的使用
    寄存器
    汇编指令
    汇编第二章_寄存器
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/7606414.html
Copyright © 2011-2022 走看看