Last post Dec 16, 2016 07:13 AM by Cathy Zou
Dec 15, 2016 12:35 PM|hayriyilmaz|LINK
I am storing Excel files in varbinary(max) field in sql server. Now I need to read those files from varbinary(max) field into ClosedXML worksheet in vb. How can I do that ?
Dec 15, 2016 12:49 PM|navneetmitawa|LINK
Dec 15, 2016 01:58 PM|hayriyilmaz|LINK
Thanks for the link, very useful indeed. But I don't need to download the file, Just programmatically process the file on server side without actually creating the file on server's hard disk.
Dec 15, 2016 06:22 PM|PatriceSc|LINK
I don't know this particular library but you should have multiple constructors. Don't you have one that would allow to load the document from a Stream for example ?
Edit: if this is found at
https://github.com/ClosedXML/ClosedXML/blob/daa413d77cf94b2fc026b68938d7e7b1c301753c/ClosedXML/Excel/XLWorkbook.cs then you do have Stream based constructor (line 700 and more).
You could try
http://www.csharp411.com/c-convert-string-to-stream-and-stream-to-string/ to convert your string to a Stream and start from this Stream to create your workbook.
Dec 16, 2016 07:13 AM|Cathy Zou|LINK
From your description, you store you excel varbinary in sql sever. You want read data from sql server using ClosedXml.
However, you don’t want to download the excel in server Disk.
I think that if you use ClosedXml to read data, it is need for us to download the excel file for ClosedXml need a file Path.
You could delete the file after read data using the code below: