Reading data from an Excel spreadsheet

S

S_K

Hi,

I have a need to read data from an Excel spreadsheet using ASP.NET
(C# ). The data is then displayed in various locations on the web
site. This should be very simple and I have been following David
Hayden's excellent article on this (http://davidhayden.com/blog/dave/
archive/2006/05/26/2973.aspx) but I get type or namespace could not be
found errors when I build. I've tried to include a reference for the
following:

System.Data.Odbc.OdbcFactory
System.Data.OleDb.OleDbFactory
System.Data.SqlClient.SqlClientFactory

However I can't find any references for the above namespaces in the
"Add Reference" .Net or COM sections.

Is there anyway to easly read the cells from an Excel speadsheet?

Thanks in advance so much for your help!

Steve
 
A

Aidy

Don't automate Office from a web app, it isn't supported.

Beyond that you need to ensure Office is actually installed on your web
server and the machine you are compiling on.
 
C

Cowboy \(Gregory A. Beamer\)

David is using the Enterprise Library. You can download it from:
http://tinyurl.com/2blmwa

You can also use the standard OLEDB bits, but you will have to have the Jet
libraries installed. They are not part of the standard MDAC install as of
MDAC 2.8, so you have to install them separately.
 
S

S_K

Don't automate Office from a web app, it isn't supported.

Beyond that you need to ensure Office is actually installed on your web
server and the machine you are compiling on.










- Show quoted text -

So how do I collect data from Excel if I shouldn't automate Office
from a web application? Should I be creating an .exe app?
 
J

Juan T. Llibre

re:
!> So how do I collect data from Excel if I shouldn't automate
!> Office from a web application? Should I be creating an .exe app?

No. Don't create an .exe app.

Use a component like GemBox.Spreadsheet Free :

http://www.gemboxsoftware.com/GBSpreadsheetFree.htm

It's free, although it has some limitations:

1. Maximum number of rows per sheet is 150.
2. Maximum number of sheets per workbook is 5.

If you can live with the limitations, use the free version.
Otherwise, purchase the Professional version.






Don't automate Office from a web app, it isn't supported.

Beyond that you need to ensure Office is actually installed on your web
server and the machine you are compiling on.










- Show quoted text -

So how do I collect data from Excel if I shouldn't automate Office
from a web application? Should I be creating an .exe app?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top