如何在不使用oledb提供程序的情况下将excel文件xlsx读取到网格视图,因为它没有在godaddy服务器上注册?

编程入门 行业动态 更新时间:2024-10-27 19:23:08
本文介绍了如何在不使用oledb提供程序的情况下将excel文件xlsx读取到网格视图,因为它没有在godaddy服务器上注册?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在不使用oledb提供程序的情况下将excel文件xlsx读取到网格视图,因为它没有在godaddy服务器上注册? 或者有没有办法过来' Microsoft.ACE.OLEDB.12.0'提供程序未在godaddy上的本地计算机上注册

解决方案

您可以使用msdn.microsoft/en-us/library/microsoft。 office.tools.excel(v = vs.110).aspx [ ^ ] 这是Microsoft.Office.Tools。 Excel命名空间 然后你必须阅读工作表并构建一些与gridview数据绑定的东西,逻辑选择是DataTable,因为它也支持列和行以类似的方式。事实上,这就是使用ole提供者会像其他例子那样做的事情,据我所知你不想做的原因,但会有更多隐含的替代做同样的事情 nice-tutorials.blogspot.dk/2011/05/ import-excel-data-to-gridview.html [ ^ ]

为您提供多种选择。 1.使用 Open XML [ ^ ]。对于所有资源 - 宣布发布Open XML SDK 2.0 [ ^ ]。 2.其他开源库提到这里 [ ^ ]。

我在需要运行时引擎的GoDaddy托管网站上遇到了问题,即Crystal Reports。 我在服务器上遇到了一个无法在我的应用程序中使用Office.Interop .dll的问题。我发现这种在Excel中构建数据的好方法,没有任何额外的Office .dll。检查此链接,如果适合您,请告诉我。可能会为你编写一些代码,但是一旦你把它弄下来,这是值得的。它也来自MSDN,因此您不必担心第三方问题。 msdn.microsoft/en-us/library/office/aa140066%28v=office.10%29.aspx [ ^ ]

How to read excel file xlsx to a grid view without oledb provider as it's not registered at godaddy server?? or is there a way to over come 'Microsoft.ACE.OLEDB.12.0' provider which is not registered on the local machine on godaddy

解决方案

You can manipulate the Excel file using msdn.microsoft/en-us/library/microsoft.office.tools.excel(v=vs.110).aspx[^] which is the Microsoft.Office.Tools.Excel namespace You'll then have to read the worksheet and construct something that will databind with your gridview, a logical choise would be a DataTable as it also supports columns and rows in a similar way. In fact that is what using an ole provider will do like this other example which as i understand you don't want to do for reasons, but there would be a bit more implicit alternative of doing the same nice-tutorials.blogspot.dk/2011/05/import-excel-data-to-gridview.html[^]

Couple of options for you. 1. Use Open XML[^]. For all resources - Announcing the Release of the Open XML SDK 2.0[^]. 2. Other open source library mentioned here[^].

I ran into issues on GoDaddy hosted websites that required runtime engines, i.e. Crystal Reports. I also ran into an issue on a server that couldn't use the Office.Interop .dll in my application. I found this nice way of building data in Excel without any extra Office .dlls. Check this link out and let me know if that works for you. Probably some more coding for you, but once you get it down, it's worth it. It's also from the MSDN, so you don't have to worry about 3rd Party issues. msdn.microsoft/en-us/library/office/aa140066%28v=office.10%29.aspx[^]

更多推荐

如何在不使用oledb提供程序的情况下将excel文件xlsx读取到网格视图,因为它没有在godaddy服务器上注册?

本文发布于:2023-11-11 04:58:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577436.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网格   因为它   视图   情况下   器上

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!