资源简介

C# 读取csv/excel文件内容至dataset,然后 将dataset绑定至datagridview

资源截图

代码片段和文件信息


using DataCompareTool.Utils;
using ExcelDataReader;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace DataCompareTool
{
    public partial class Form1 : Form
    {
        //protected string databasePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) “MyData.db“);
        protected string databasePath = Path.Combine(AppDomain.CurrentDomain.baseDirectory “user.db“);
        public Form1()
        {
            InitializeComponent();


        }

        private void btnImportSmarket_Click(object sender EventArgs e)
        {
          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-08-26 09:22  .vs\
     目录           0  2019-08-26 10:04  .vs\DataCompareTool\
     目录           0  2019-08-26 10:04  .vs\DataCompareTool\DesignTimeBuild\
     文件         184  2019-08-26 10:04  .vs\DataCompareTool\DesignTimeBuild\.dtbcache
     目录           0  2019-08-26 09:28  .vs\DataCompareTool\v15\
     文件       70144  2019-08-26 10:04  .vs\DataCompareTool\v15\.suo
     目录           0  2019-08-26 09:28  .vs\DataCompareTool\v15\Server\
     目录           0  2019-08-26 09:28  .vs\DataCompareTool\v15\Server\sqlite3\
     文件           0  2019-08-26 09:28  .vs\DataCompareTool\v15\Server\sqlite3\db.lock
     文件        4096  2019-08-26 09:28  .vs\DataCompareTool\v15\Server\sqlite3\storage.ide
     文件       32768  2019-08-26 09:28  .vs\DataCompareTool\v15\Server\sqlite3\storage.ide-shm
     文件     1339032  2019-08-26 09:56  .vs\DataCompareTool\v15\Server\sqlite3\storage.ide-wal
     文件         186  2019-08-26 09:26  App.config
     文件        5900  2019-08-26 09:56  DataCompareTool.csproj
     文件        1128  2019-08-26 09:24  DataCompareTool.sln
     文件        6645  2019-08-26 09:29  Form1.Designer.cs
     文件        6969  2019-08-26 09:38  Form1.cs
     文件        5817  2019-08-26 09:29  Form1.resx
     文件         527  2019-08-24 11:42  Program.cs
     目录           0  2019-08-26 09:22  Properties\
     文件        1328  2019-08-24 11:42  Properties\AssemblyInfo.cs
     文件        2871  2019-08-26 09:26  Properties\Resources.Designer.cs
     文件        5612  2019-08-24 11:42  Properties\Resources.resx
     文件        1115  2019-08-26 09:26  Properties\Settings.Designer.cs
     文件         249  2019-08-24 11:42  Properties\Settings.settings
     目录           0  2019-08-26 09:38  Utils\
     文件        5457  2019-08-26 09:38  Utils\ExportExcel.cs
     目录           0  2019-08-26 09:22  bin\
     目录           0  2019-08-26 09:59  bin\Debug\
     文件       16896  2019-08-26 09:59  bin\Debug\DataCompareTool.exe
     文件         186  2019-08-26 09:26  bin\Debug\DataCompareTool.exe.config
............此处省略335个文件信息

评论

共有 条评论