Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Reading data from an Excel spreadsheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
S_K - 26 Mar 2008 15:32 GMT
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
Aidy - 26 Mar 2008 15:53 GMT
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.

> Hi,
>
[quoted text clipped - 18 lines]
>
> Steve
S_K - 26 Mar 2008 16:11 GMT
> Don't automate Office from a web app, it isn't supported.
>
[quoted text clipped - 25 lines]
>
> - 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?
Juan T. Llibre - 26 Mar 2008 16:53 GMT
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.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
On Mar 26, 8:53 am, "Aidy" <noem...@noemail.xxx> wrote:
> Don't automate Office from a web app, it isn't supported.
>
[quoted text clipped - 29 lines]
>
> - 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?
Cowboy (Gregory A. Beamer) - 26 Mar 2008 15:54 GMT
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.

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************

| Think outside the box!

*************************************************
> Hi,
>
[quoted text clipped - 18 lines]
>
> Steve

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.