zoukankan      html  css  js  c++  java
  • C#找到Excel中的所有Sheetname的方法

    #region 找到Excel的所有Sheetname
            /// <summary>
            /// 找到Excel的所有Sheetnames
            /// </summary>
            /// <returns>返回Sheetnames</returns>
            private List<string> ExcelSheetName()
            {
                string conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + txt_Filepath.Text + ";Extended Properties=Excel 8.0;";
                List<string> sheetNames = new List<string>();
                using (OleDbConnection con = new OleDbConnection(conString))
                {
                    con.Open();
                    System.Data.DataTable sheetName = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "table" });
                    con.Close();
                    foreach (DataRow var in sheetName.Rows)
                    {
                        sheetNames.Add(var[2].ToString());
                    }
                }
                return sheetNames;
            }
            #endregion

  • 相关阅读:
    sharepoint email
    After delete Trigger throw error:The row value(s) updated or deleted either do not make the row unique or they alter multiple rows (2 rows).
    ios 开发书籍
    NES 指令
    nes相关开发资料
    nes相关开发资料
    怎样写模拟器
    Zope简介
    C#中new和override区别
    NES 指令
  • 原文地址:https://www.cnblogs.com/jasonjiang/p/1787819.html
Copyright © 2011-2022 走看看