excel数据源错误 [英] excel datasource error

查看:720
本文介绍了excel数据源错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过以下连接字符串连接Excel 2010 .xslm: -



I am trying to connect Excel 2010 .xslm thru below connection string: -

string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;
               Data Source=F:\Project Chunauti\OCCL Mundra Dashboard U1.xlsm;Extended Properties=""Excel 12.0 Macro;\""";





仅当在excel中打开提到的文件时才有效。但对于.xlsx文件,它可以工作。



查询结果也很慢,无法填充C#datagridview。



如果未打开此文件,则会显示错误外部表格不符合预期格式。



请随便。



---谢谢。

--- Anil



It works only when the mentioned file is opened in excel. But for .xlsx file it works.

Query result also gone very slow to fill C# datagridview.

When this file is not opened, it gives an error "External table is not in the expected format."

Any idea please.

--- Thanks.
--- Anil

推荐答案

在某些情况下你需要添加特殊属性,例如: HDR =是和/或 IMEX = 1

进一步信息如下: http://www.connectionstrings.com/excel/ [ ^ ]



如果不起作用,请提供有关您的数据结构的更多详细信息。
In some cases you need to add special properties, like: HDR=yes and /or IMEX=1
For further information have look here: http://www.connectionstrings.com/excel/[^]

If it won't help, please provide more details about your data structure.


这篇关于excel数据源错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆