• 大小: 2.33M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签:

资源简介

NPOI操作Execel

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using NPOI.XSSF.UserModel;
using NPOI.SS.UserModel;
using System.IO;
using System.Data;

namespace Lucky.NPOI.Excel
{
    class Program
    {
        #region Const

        private const string CONST_DONE_SUCCESS = “操作成功!“;
        private const string CONST_DONE_FAILUER = “操作失败!“;

        #endregion

        static void Main(string[] args)
        {
            ExcelToDatabase();
        }

        #region 读取Excel数据并插入到数据库中

        /// 
        /// 
        /// 

        public static void ExcelToDatabase()
        {
            var strRes = string.Empty;
            var strError = string.Empty;

            var strSql = @“insert into student values(‘{0}‘‘{1}‘‘{2}‘‘{

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       9568  2013-08-25 23:53  Lucky.NPOI.Excel\bin\Debug\data\helloWorld.xlsx

     文件     200704  2013-06-04 07:21  Lucky.NPOI.Excel\bin\Debug\ICSharpCode.SharpZipLib.dll

     文件      15872  2013-08-26 00:04  Lucky.NPOI.Excel\bin\Debug\Lucky.NPOI.Excel.exe

     文件      38400  2013-08-26 00:04  Lucky.NPOI.Excel\bin\Debug\Lucky.NPOI.Excel.pdb

     文件      11600  2013-08-26 00:04  Lucky.NPOI.Excel\bin\Debug\Lucky.NPOI.Excel.vshost.exe

     文件        490  2010-03-17 22:39  Lucky.NPOI.Excel\bin\Debug\Lucky.NPOI.Excel.vshost.exe.manifest

     文件    1444352  2013-06-04 07:21  Lucky.NPOI.Excel\bin\Debug\NPOI.dll

     文件     355328  2013-06-04 07:21  Lucky.NPOI.Excel\bin\Debug\NPOI.OOxml.dll

     文件      78336  2013-06-04 07:21  Lucky.NPOI.Excel\bin\Debug\NPOI.Openxml4Net.dll

     文件    1314816  2013-06-04 07:21  Lucky.NPOI.Excel\bin\Debug\NPOI.OpenxmlFormats.dll

     文件    2015980  2013-06-04 07:21  Lucky.NPOI.Excel\bin\Debug\NPOI.xml

     文件       9568  2013-08-25 23:53  Lucky.NPOI.Excel\data\helloWorld.xlsx

     文件      30744  2013-08-18 22:44  Lucky.NPOI.Excel\Helper\DbHelperSQL.cs

     文件     200704  2013-06-04 07:21  Lucky.NPOI.Excel\Lib\ICSharpCode.SharpZipLib.dll

     文件    1444352  2013-06-04 07:21  Lucky.NPOI.Excel\Lib\NPOI.dll

     文件     355328  2013-06-04 07:21  Lucky.NPOI.Excel\Lib\NPOI.OOxml.dll

     文件      78336  2013-06-04 07:21  Lucky.NPOI.Excel\Lib\NPOI.Openxml4Net.dll

     文件    1314816  2013-06-04 07:21  Lucky.NPOI.Excel\Lib\NPOI.OpenxmlFormats.dll

     文件    2015980  2013-06-04 07:21  Lucky.NPOI.Excel\Lib\NPOI.xml

     文件       4258  2013-08-24 11:03  Lucky.NPOI.Excel\Lucky.NPOI.Excel.csproj

     文件       6734  2013-08-26 00:04  Lucky.NPOI.Excel\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        986  2013-08-26 00:04  Lucky.NPOI.Excel\obj\x86\Debug\Lucky.NPOI.Excel.csproj.FileListAbsolute.txt

     文件      15872  2013-08-26 00:04  Lucky.NPOI.Excel\obj\x86\Debug\Lucky.NPOI.Excel.exe

     文件      38400  2013-08-26 00:04  Lucky.NPOI.Excel\obj\x86\Debug\Lucky.NPOI.Excel.pdb

     文件       6298  2013-08-26 00:04  Lucky.NPOI.Excel\Program.cs

     文件       1388  2013-06-04 07:19  Lucky.NPOI.Excel\Properties\AssemblyInfo.cs

     目录          0  2013-08-26 00:05  Lucky.NPOI.Excel\obj\x86\Debug\TempPE

     目录          0  2013-08-26 00:05  Lucky.NPOI.Excel\bin\Debug\data

     目录          0  2013-08-26 00:05  Lucky.NPOI.Excel\obj\x86\Debug

     目录          0  2013-08-26 00:05  Lucky.NPOI.Excel\bin\Debug

............此处省略12个文件信息

评论

共有 条评论

相关资源