I want to use ADO.net to extract some data from an Excel file. This process is pretty well documented on the internet. My catch is that my file has been uploaded by a user, and so exists only as a byte array in memory. For security and performance reasons I would rather not write this file to disk.
Is there a way of constructing a connection string that connects to a byte array? Or perhaps exposing that array as a file that is actually stored in memory (like a RAM disk I guess)?
You can’t connect if it only exists in memory. OLE is also ruled out (though using Office Automation for a server application is poor design to begin with).
The only way I can think of is to read the binary Excel data yourself – for example use SpreadSheetGear.Net with something like: