HyperBPP
asked on
c# reading varbinary or byte[] to .xlsx
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).
Thanks!
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).
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
MemoryStream excelMemStream = new MemoryStream();
excelMemStream.Write(fileB
SpreadsheetDocument mySpreadsheet = SpreadsheetDocument.Open(e
Although, this seems slow. Anyone know faster solution?