Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Memory OleDbConnection to Excel File

I would like to open an OleDbConnection to an Excel file that's in memory as a FileStream. Does anyone know if this is possible and how to accomplish it?

Big picture I would like to pass the file bytes into a .NET CLR Stored Procedure and extract the data. Perhaps there's a better way to do this that I've not considered.

Thanks in advance.

like image 769
javacavaj Avatar asked May 26 '09 02:05

javacavaj


1 Answers

You can use SpreadsheetGear to open a file from a byte array in memory or from any stream with SpreadsheetGear.Factory.GetWorkbookSet().Workbooks.OpenFromMemory(byte[]) / OpenFromStream(System.IO.Stream).

Disclaimer: I own SpreadsheetGear LLC

like image 85
Joe Erickson Avatar answered Nov 03 '22 01:11

Joe Erickson