WinForm Retrieve Excel file from SQL Server and Open it

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

My Excel .xls files are stored as image on the SQL Server.
Now I would like to retrieve the .xls files and open it.
I use the FileStream and write it on client pc's C;\.
How do I open it in the C# code, so that user won't need to go the file
explorer to open?
Thanks for help.


Jason
 
Jason said:
Hi,

My Excel .xls files are stored as image on the SQL Server.
Now I would like to retrieve the .xls files and open it.
I use the FileStream and write it on client pc's C;\.
How do I open it in the C# code, so that user won't need to go the file
explorer to open?
Thanks for help.


Jason

Try using Process.Start(@"c:\somefile.xls"); This opens the file with
the default application, which would be Excel.
 
Try using Process.Start(@"c:\somefile.xls"); This opens the file with the
default application, which would be Excel.

Hate to sound obvious, but it should be mentioned that the file will need to
be SAVED somewhere first; you won't simply be able to open it from memory.
 
Jeff Johnson said:
Hate to sound obvious, but it should be mentioned that the file will need to
be SAVED somewhere first; you won't simply be able to open it from memory.

The OP said that they use the FileStream and write it on the clients pc. I
took that to mean they did the obvious step.

Mike
 
It helps!
Thank you very much!


Family Tree Mike said:
Try using Process.Start(@"c:\somefile.xls"); This opens the file with the
default application, which would be Excel.
 
Back
Top