c# reading varbinary or byte to .xlsx
Posted on 2012-08-22
I am working with a c# in visual studio 2010 and MS SQL Server 2008 R2.
Another application is inserting .xlsx files into an SQL table as varbinary(max). I need to pull these from the table and read the contents as if they are .xlsx files.
First, do I read these as byte to get the varybinary out of the database?
Then, once I have my file binary/byte string how to I convert this to a file that can be read as an excel workbook in C# with the SpreadsheetDocument class (using DocumentFormat.openxml, openxml.packaging, and openxml.spreadsheet).