惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Troy Hunt's Blog
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
F
Full Disclosure
Recorded Future
Recorded Future
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
博客园_首页
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hacker News: Front Page
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
博客园 - 司徒正美
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
Cloudbric
Cloudbric
PCI Perspectives
PCI Perspectives
有赞技术团队
有赞技术团队
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
L
Lohrmann on Cybersecurity
量子位
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tailwind CSS Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
N
News and Events Feed by Topic
罗磊的独立博客
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
T
Tor Project blog
IT之家
IT之家
M
MIT News - Artificial intelligence
S
Security @ Cisco Blogs
O
OpenAI News
AI
AI
S
Securelist
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题

博客园 - 瓶子

泛型抽象厂。模式练习1 范型与反射乱画。 小技巧:用javascript实现asp.net中ispostback功能! - 瓶子 - 博客园 给定一个集合,求出其所有子集合 ObjectARX 2007已经发布一个多月了.贴下载地址! sql server 2005 排序规则与大小写敏感   (sql server2005学习笔记1) HELLO MONO! 德里达逝世了! - 瓶子 - 博客园 Is there any way to get detailed error information for Win32 errors when using Platform Invoke? CBI——宇宙新的婴儿照片 Longhorn的糟糕体验! en! ~c#真的好简洁。贴段C#到VB的小典型。 为什么ICON类型没有EQUALS方法呢? 与音乐,,纪念Arthur Rimbaud诞辰150周年 SharpDevelop 并不RUN OUTSIDE IIS 的RUN OUTSIDE IIS 有关SQL排序规则---------即"无法解决 equal to 操作的排序规则冲突"等等的菜问题. 兰波生平 今天,终于注册了BLOG了.是菜鸟.请大家关照! 还有我的小简介
把以"文本文件(制表符分割)"保存的EXCEL文件导进SQLSERVER2000的DEMO!
瓶子 · 2006-04-30 · via 博客园 - 瓶子

     任务:使用asp.net把*.zip包中压缩好的相同式样的excel数据文件导入SQL SERVER2000.

     汗,我真不知道怎么组织这个篇文章,应该是很小儿科目的东西.再是我认为写出来对新手还是有点看看的价值的。那天同学偷懒找我给他做个小TASK,要求用把*.zip包中压缩好的相同式样的excel数据文件导入SQL SERVER2000.由于没有接触到excel方面的开发,我想当然的认为Sql Server 2000 的OPENDATASOURCE  +  Jet OLE DB 提供程序即可完成任务,经过N次的尝试,錯誤N次。直到我把用来测试的excel文件打开之后,准备另存为时才发现其是以"文本文件(制表符分割)"保存的!此才豁然开朗,把測試用excel数据文件直接重命名为.TXT文件,使用BULK INSERT语句解决!
 首先,我把此excel文件另存为excel工作簿文档,使用以下代码来获得它的表结构:

获得表结构代码

再手工给xk_customer表添加一個标识字段。

 接着,我创建了用于导入数据的存储过程如下:

数据导入存储过程

  任务完成了一半,接下来是使用ASP.NET做的一个前台程序了,其下的JavaScript的代码使inputFile的path不為空的時候,方使UpLoad-Button可用!·。 

HTML页代码

  关于主要的功能类,还是要说明一下的,其实现了zip包的解压、文件的上传、和数据库操作。解压组件使用了开源的SharpZipLib。代码入下:

主要功能类

完整的演示代码:下载