Solved

Opening Resource file into Filestream

Posted on 2013-06-17
1
369 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

730 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