程序中去读EXCEL文档,以前一直参考《Asp.net读取Excel文件 2http://www.cnblogs.com/insus/archive/2011/05/05/2037808.html这个连接语句或是方法。

但在这次开发中,再次引用时,即出现了异常:“Could not find installable ISAM”。

奇怪!

经过一番查阅资料和修改,Insus.NET把代码稍作修改一调整:

程序又可以跑起来了...

 public static string ExcelConnectionString(string filePhysicalPath)
{
string connectionString = string.Empty;
string fileExtension = filePhysicalPath.Substring(filePhysicalPath.LastIndexOf(".") + );
switch (fileExtension)
{
case "xls":
connectionString = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1\"", filePhysicalPath);
break;
case "xlsx":
connectionString = String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=YES\"", filePhysicalPath);
break;
}
return connectionString;
}

Source Code

Could not find installable ISAM的更多相关文章

  1. C# Oledb 连接Access数据库字符串

    string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbFile + ";Persist ...

  2. composer 报错:Your requirements could not be resolved to an installable set of packages 解决方法

    composer 报错: - Your requirements could not be resolved to an installable set of packages xxxxxxxxxxx ...

  3. C# EXCEL导入 混合列文字为空,找不到可安装的 ISAM的解决办法

    C# EXCEL导入 混合列文字为空,找不到可安装的 ISAM的解决办法 使用C#导入 Excel数据到 DataTable,如果连接串中只写 Excel 8.0,则正常的字符列,数值列都没有问题,但 ...

  4. System.DateUtils 3. IsPM、IsAM 判断是否为上、下午

    编译版本:Delphi XE7 function IsPM(const AValue: TDateTime): Boolean; inline;function IsAM(const AValue: ...

  5. (转)MySQL数据库引擎ISAM MyISAM HEAP InnoDB的区别

    转自:http://blog.csdn.net/nightelve/article/details/16895917 MySQL数据库引擎取决于MySQL在安装的时候是如何被编译的.要添加一个新的引擎 ...

  6. 找不到可安装的ISAM

    转载:http://www.cnblogs.com/zyc2/archive/2005/06/28/182492.html   读取excel数据 到 datagrid 出现:找不到可安装的ISAM  ...

  7. 解决c#处理excel时故障 找不到可安装的 isam

    直接拷贝的以前代码,但因软件版本,系统环境的变化,导致提示“找不到可安装的 isam”. 我目前新的软件环境:win8.1+office2010+vs2013 解决办法是修改连接字符串: 处理exce ...

  8. MySQL引擎介绍ISAM,MyISAM,HEAP,InnoDB

    MySQL数据库引擎取决于MySQL在安装的时候是如何被编译的.要添加一个新的引擎,就必须重新编译MYSQL. 在缺省情况下,MYSQL支持三个引擎:ISAM.MYISAM和HEAP.另外两种类型IN ...

  9. 读取excel数据 到 datagrid 出现 找不到可安装的ISAM

    读取excel数据 到 datagrid 出现:找不到可安装的ISAM       错误: 实在没有办法了 就仔细的查看了 一下数据链接字符串: string strConn = "Prov ...

随机推荐

  1. Permutation Sequence LT60

    The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the ...

  2. Homebrew -- mac 缺失包补充工具

    https://brew.sh/index_zh-cn.htmlhttps://brew.sh/ 非root权限下运行 # github 源代码 https://github.com/Homebrew ...

  3. oracle创建、删除 数据库、建立表空间以及插入 删除 修改表

    一.创建.删除数据库 oracle OraDb11g_home->配置和移植工具->Database configration  Assistant->...然后可以创建或者删除数据 ...

  4. MyBatis 实现新增

    MyBatis实现新增 1.概念学习:(角度不同) 1.1 功能:从应用程序角度出发,软件具有哪些功能 1.2 业务:完成功能时的逻辑,对应Service中一个方法 1.3 事务:从数据库角度出发,完 ...

  5. 26、xcode8.0 解决没有iPhone4模拟器问题

    第一步:随便打开Xcode项目 ,点击电脑屏幕右上角 Xcode->Preference 第二步: 点击下载ios 8.1 Simulator 等到下载完成即可在xcode中添加iphone4s ...

  6. MySQL批量修改表前缀

    error_reporting(0); $old_pre = 'tdr_'; // 原表前缀 $new_pre = 'db_'; // 新表前缀 // 配置连接 $db = new mysqli('1 ...

  7. (9)How to take a picture of a black hole

    https://www.ted.com/talks/katie_bouman_what_does_a_black_hole_look_like/transcript 00:13In the movie ...

  8. Mybatis-Plus 实战完整学习笔记(十一)------条件构造器删除,修改,conditon

    1.修改功能--其他过滤方式跟select一样 /** * 修改条件构造器 * @throws SQLException */ @Test public void selectUpdate() thr ...

  9. 学以致用十六-----Centos7.2编译安装mysql5.6.22

    一.系统环境 二.卸载系统自带的mariadb rpm -qa | grep db rpm -e --nodeps mariadb-libs-5.5.60 rpm -e --nodeps mariad ...

  10. MySQL在线大表DDL操作

    在线大表DDL操作的方法: 1.主从架构轮询修改 需要注意: a.主库会话级别的记录binglog的参数关闭 b.500\502错误异常捕捉 c.检查备库的second behind master是否 ...