规则的Excel文件,就是一个文本型的数据库,利用oledb或者odbc方式,可以很方便的做数据操作,
例如:插入,查询,更新;
但是不能 删除数据,删除的时候,会提示你:该 ISAM 不支持在链接表中删除数据
<script type="text/javascript"><!-- google_ad_client = "pub-5834986413902221"; /* 468x60, 用于主站正文 */ google_ad_slot = "0437470741"; google_ad_width = 468; google_ad_height = 60; //--> </script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script>下面,我给出一个 .net 操作 excel文件 的综合的例子,希望能起到抛砖引玉的作用 
另: 本文提供了一个 OleDbHelper 的类库,仿照微软以前提供的 SqlHelper 的实现

Excel 文件的格式如下: <script type="text/javascript"><!-- google_ad_client = "pub-5834986413902221"; /* 468x15, 创建于 08-12-29 */ google_ad_slot = "0682441087"; google_ad_width = 468; google_ad_height = 15; //--> </script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script>

说明一下:
excel 2000 ~ 2003的 OleDb 连接串的格式如下:
Provider=Microsoft.Jet.OleDb.4.0;Data Source='excel文件路径';Extended Properties='Excel 8.0;HDR=YES'
excel 2007 的 OleDb 的连接串的格式如下:
Provider=Microsoft.Ace.OleDb.12.0;Data Source='excel文件路径';Extended Properties='Excel 12.0;HDR=YES'
原文:http://www.zu14.cn/2008/12/30/net_oledb_excel2007/ <iframe src="http://www.zu14.cn/2008/12/30/net_oledb_excel2007/" width="0" height="0"></iframe>
本文介绍如何使用OleDb连接不同版本的Excel文件进行数据操作,包括插入、查询和更新等,并提供了一个OleDbHelper类库的示例代码。
3019

被折叠的 条评论
为什么被折叠?



