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

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

  • 相关阅读:
    HDU4911——归并排序——Inversion
    HDU5400——Arithmetic Sequence
    HDU5396——区间DP+排列组合——Expression
    DFS(连通块) ZOJ 2743 Bubble Shooter
    Codeforces Round #345 (Div. 2)
    Codeforces Round #344 (Div. 2)
    8VC Venture Cup 2016
    Manthan, Codefest 16
    DP(记忆化搜索) + AC自动机 LA 4126 Password Suspects
    全排列 UVA 11525 Permutation
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/7606414.html
Copyright © 2011-2022 走看看