?
Solved

Opening Resource file into Filestream

Posted on 2013-06-17
1
Medium Priority
?
394 Views
Last Modified: 2013-08-08
Hi,

I’ve added a file as a resource to a project.  The file is an Excel document.

I’m trying to use this within the ASPose Cells framework.  Their documentation states it can open a file from a file stream.  However I’m at a complete loss as to how to get from a resource to a file stream?

Does anybody have any snippets they could share?

Here is the code that I have:

//Create a Stream object
FileStream fstream = new FileStream("C:\\book1.xls", FileMode.Open);

//Creating a Workbook object, open the file from a Stream object
//that contains the content of file and it should support seeking
Workbook workbook = new Workbook(fstream);

Open in new window

0
Comment
Question by:andyw27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 39252785
from http://www.aspose.com/docs/display/cellsnet/Opening+an+Excel+File:

//Opening an Excel file as a stream
FileStream fs = File.OpenRead("c:\\book1.xls");

//Loading the Excel file contents into the control from a stream
gridDesktop1.ImportExcelFile(fs);

//Closing stream
fs.Close();
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question