How to query Excel data which is in memory using O

2019-07-29 06:01发布

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?

标签: c# excel ado.net
2条回答
forever°为你锁心
2楼-- · 2019-07-29 06:34

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.

查看更多
beautiful°
3楼-- · 2019-07-29 06:47

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

查看更多
登录 后发表回答