資源簡(jiǎn)介
c#實(shí)現(xiàn)從Excel導(dǎo)入數(shù)據(jù)到textbox中
代碼片段和文件信息
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.OleDb;
namespace?WindowsFormsApplication5
{
????public?partial?class?Form1?:?Form
????{
????????OpenFileDialog?ofd?=?null;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????ofd?=?new?OpenFileDialog();
????????????ofd.Multiselect?=?false;
????????????ofd.InitialDirectory?=?“D:\\“;
????????????ofd.Filter?=?“Excel?(.xls)|*.xls|Excel(.xlsx)|*.xlsx“;
????????????ofd.RestoreDirectory?=?true;
????????????if?(ofd.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????DataSet?ds?=?ExecleDs(ofd.FileName);???????????//調(diào)用自定義方法
????????????????DataRow[]?dr?=?ds.Tables[0].Select();????????????//定義一個(gè)DataRow數(shù)組
????????????????int?rowsnum?=?ds.Tables[0]
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????10752??2009-11-12?11:24??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.exe
?????文件??????26112??2009-11-12?11:24??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.pdb
?????文件??????14328??2009-11-12?16:31??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.vshost.exe
?????文件????????490??2009-06-11?05:14??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\bin\Debug\WindowsFormsApplication5.vshost.exe.manifest
?????文件???????3164??2009-11-12?16:32??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Form1.cs
?????文件???????3351??2009-11-12?16:32??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Form1.Designer.cs
?????文件???????6017??2009-11-12?16:32??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Form1.resx
?????文件????????915??2009-11-12?16:31??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.csproj.FileListAbsolute.txt
?????文件????????847??2009-11-12?11:24??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.csproj.GenerateResource.Cache
?????文件??????10752??2009-11-12?11:24??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.exe
?????文件????????180??2009-11-12?11:24??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.Form1.resources
?????文件??????26112??2009-11-12?11:24??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.pdb
?????文件????????180??2009-11-12?10:44??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug\WindowsFormsApplication5.Properties.Resources.resources
?????文件????????505??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Program.cs
?????文件???????1380??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Properties\AssemblyInfo.cs
?????文件???????2898??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Properties\Resources.Designer.cs
?????文件???????5612??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Properties\Resources.resx
?????文件???????1109??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Properties\Settings.Designer.cs
?????文件????????249??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Properties\Settings.settings
?????文件???????3759??2009-11-12?10:39??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\WindowsFormsApplication5.csproj
?????文件????????962??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5.sln
????..A..H.?????14336??2009-11-12?16:32??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5.suo
?????目錄??????????0??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug\TempPE
?????目錄??????????0??2009-11-12?10:47??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\bin\Debug
?????目錄??????????0??2009-11-12?11:24??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj\Debug
?????目錄??????????0??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\bin
?????目錄??????????0??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\obj
?????目錄??????????0??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5\Properties
?????目錄??????????0??2009-11-12?16:32??從Excel導(dǎo)入數(shù)據(jù)到textbox中\(zhòng)WindowsFormsApplication5
?????目錄??????????0??2009-11-12?10:34??從Excel導(dǎo)入數(shù)據(jù)到textbox中
............此處省略4個(gè)文件信息
評(píng)論
共有 條評(píng)論