SqlBulkCopy上传Excel
如果我在 sql 2008 R2 数据库上使用 .net 4.0 中的 SqlBulkCopy 将 Excel 数据上传到数据库,我是否真的需要在托管该网站的盒子上安装 Excel 才能实现此操作?
我问的原因是我有一个网站正在运行,并且托管箱有excel。客户希望将网站移至一个新的盒子,该盒子没有 Excel,并且批量复制不起作用。除了没有excel之外,没有其他区别。
谢谢
If Im using SqlBulkCopy in .net 4.0 on a sql 2008 R2 database to upload excel data to the database, do I actually need Excel on the box hosting the site for this to work?
The reason I ask is I have a site up and running with this, and the hosting box has excel. The customer wants the site moved to a new box, this one doesnt have Excel and that bulk copy doesnt work. Other than the lack of excel there is no other difference.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Microsoft Excel 对象库 (COM Interop) 与 .Net 4 中的 Excel 交互,那么您需要安装 Excel,因为它与 Excel 对象库交互。
您的 C# 项目参考资料是什么?
任何与办公自动化相关的东西都需要办公室的一部分实现自动化。另外,如果是.Net 4,则可以使用dynamic关键字引用该对象。
如果不了解项目、参考资料和相关代码,很难准确判断。
但是,有几个第三方库允许在未安装 Excel 的情况下与 Excel 进行交互。因此,如果您需要在没有 Excel 的情况下工作,请考虑使用它们。
If you are using the Microsoft Excel Object Library (COM Interop) to interface with Excel from .Net 4, then yes you need Excel installed as that is interfacing with the Excel object library.
What are your project references in C#?
Anything link to office automatiion would need taht part of office that is being automated. Also, if .Net 4 that objects may be referenced with the dynamic keyword.
Hard to tell exactly without knowing the project, references, and relevant code.
However, there are several third party libraries that allow interaction with Excel without having Excel installed. So, if you need to work without Excel, investigate using those.