• 读取Excel中的数据


    /// <summary>
            /// 转换Excel文件转换为DataSet
            /// </summary>
            /// <returns>DataSet</returns>
            private DataSet GetExcelData()
            {
                string strConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + this.textBox1.Text.Trim() +"; Extended Properties=Excel 8.0; ";
                DataSet myDataSet = new DataSet();
                try
                {
                    OleDbConnection conn = new OleDbConnection(strConn);
                    //Sheet1$为Excel的工作表名称
                    OleDbDataAdapter myCommand = new OleDbDataAdapter("SELECT * FROM [Sheet1$] ", strConn);
                    myCommand.Fill(myDataSet);
                }
                catch (Exception exp)
                {
                    MessageBox.Show("导入Excel失败!!!"+exp.Message);
                }
                return myDataSet;
            }
  • 相关阅读:
    3 saltstack高可用
    2 salt-masterless架构
    1 salt执行模块开发
    git push 后 链接总是灰色点击没有反应
    4. Beego 框架之cookie与session
    19 Go的全能ORM简单入门
    K8S
    Docker
    Python
    TS
  • 原文地址:https://www.cnblogs.com/snlfq2000/p/1819061.html
Copyright © 2020-2023  润新知