Excel的参考资料 [英] References for Excel

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

问题描述

我正在尝试将Excel文件数据传输到MS SQL数据库。



我添加了Excel 12.0的参考资料:

Microsoft。 Office.Interop.Excel

Interop.ADODB

Interop.ADOR

Interop.ADOX

Interop.DAO



错误代码:

I am trying to transfer Excel file data to a MS SQL database.

I added References for Excel 12.0:
Microsoft.Office.Interop.Excel
Interop.ADODB
Interop.ADOR
Interop.ADOX
Interop.DAO

Error Code:

Could not load type 'Microsoft.Office.Interop.Excel._Application' from assembly 'Excel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The type is marked as eligible for type equivalence, but the containing assembly is not loaded as fully trusted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type 'Microsoft.Office.Interop.Excel._Application' from assembly 'Excel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The type is marked as eligible for type equivalence, but the containing assembly is not loaded as fully trusted.

推荐答案

参见这个StackOverflow [ ^ ] answer。



要求你禁用嵌入互操作程序集并在配置文件中设置完整的信任参数。
See this StackOverflow[^] answer.

Requires you to disable embedding interop assemblies and set a full trust parameter in the configuration file.


这篇关于Excel的参考资料的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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