How to query Excel data which is in memory using OLEDB?

江枫思渺然 提交于 2020-01-16 05:31:29

问题


I have a file upload control on a web page. Users will upload the excel files and in my code, first I save the excel file to the disk and then open it with OLEDB connection and do my stuff. My question is: Is there anyway to avoid saving this file to disk?


回答1:


No. The file exists probably as a text stream data reader somewhere in the file upload control. To get at it, you would have to hack the control or the HttpHandler that is processing the upload, which would not be fun.

Saving it to a file is the best way. It provides you with a well-defined, standardized interface into the file.




回答2:


SpreadsheetGear for .NET can open a workbook from a file, System.IO.Stream or byte[], so you can load a workbook without saving it to disk.

You can download a free trial here.

Disclaimer: I own SpreadsheetGear LLC



来源:https://stackoverflow.com/questions/1490526/how-to-query-excel-data-which-is-in-memory-using-oledb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!