资源简介

C#实现Excel的导入,导出,希望对你有帮助、、

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Data.OleDb;

namespace aa
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            MyFileName = @“F:\\Book.XLS“;
            MyTableName = “Sheet1“;
        }
        string MyFileName = null;
        string MyTableName = null;
     
        private void DaoRu()
        {
            try
            {
                string MyConnectionstring = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\\Book.XLS;Extended Properties=‘Excel 8.0;HD

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-05-19 18:47  导Excel\
     目录           0  2011-07-20 16:04  导Excel\aa\
     文件        4612  2011-05-19 15:33  导Excel\aa\Form1.Designer.cs
     文件        4302  2011-07-20 16:04  导Excel\aa\Form1.cs
     文件        6430  2011-05-19 15:33  导Excel\aa\Form1.resx
     文件         483  2011-05-19 14:25  导Excel\aa\Program.cs
     目录           0  2011-05-19 14:25  导Excel\aa\Properties\
     文件        1336  2011-05-19 14:25  导Excel\aa\Properties\AssemblyInfo.cs
     文件        2854  2011-05-19 14:25  导Excel\aa\Properties\Resources.Designer.cs
     文件        5612  2011-05-19 14:25  导Excel\aa\Properties\Resources.resx
     文件        1087  2011-05-19 14:25  导Excel\aa\Properties\Settings.Designer.cs
     文件         249  2011-05-19 14:25  导Excel\aa\Properties\Settings.settings
     文件        3750  2011-05-19 14:26  导Excel\aa\aa.csproj
     目录           0  2011-05-19 14:25  导Excel\aa\bin\
     目录           0  2011-05-19 14:33  导Excel\aa\bin\Debug\
     文件       11776  2011-07-20 16:01  导Excel\aa\bin\Debug\aa.exe
     文件       26112  2011-07-20 16:01  导Excel\aa\bin\Debug\aa.pdb
     文件       14328  2011-07-20 16:02  导Excel\aa\bin\Debug\aa.vshost.exe
     文件         490  2009-06-11 05:14  导Excel\aa\bin\Debug\aa.vshost.exe.manifest
     目录           0  2011-05-19 14:25  导Excel\aa\obj\
     目录           0  2011-07-20 16:01  导Excel\aa\obj\Debug\
     目录           0  2011-07-20 16:04  导Excel\aa\obj\Debug\TempPE\
     文件         180  2011-05-19 15:35  导Excel\aa\obj\Debug\aa.Form1.resources
     文件         180  2011-05-19 14:26  导Excel\aa\obj\Debug\aa.Properties.Resources.resources
     文件         818  2011-07-20 16:02  导Excel\aa\obj\Debug\aa.csproj.FileListAbsolute.txt
     文件         847  2011-05-19 15:35  导Excel\aa\obj\Debug\aa.csproj.GenerateResource.Cache
     文件       11776  2011-07-20 16:01  导Excel\aa\obj\Debug\aa.exe
     文件       26112  2011-07-20 16:01  导Excel\aa\obj\Debug\aa.pdb
     文件         896  2011-05-19 14:25  导Excel\aa.sln
     文件       17408  2011-07-20 16:04  导Excel\aa.suo
     目录           0  2011-05-19 18:46  导Excel\第二种方法导Excel\
............此处省略37个文件信息

评论

共有 条评论