Reading data from an Excel spreadsheet

Discussion in 'ASP .Net' started by S_K, Mar 26, 2008.

  1. S_K

    S_K Guest

    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
     
    S_K, Mar 26, 2008
    #1
    1. Advertising

  2. S_K

    Aidy Guest

    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.

    "S_K" <> wrote in message
    news:...
    > 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, Mar 26, 2008
    #2
    1. Advertising

  3. 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.

    --
    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!
    |
    *************************************************
    "S_K" <> wrote in message
    news:...
    > 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
     
    Cowboy \(Gregory A. Beamer\), Mar 26, 2008
    #3
  4. S_K

    S_K Guest

    On Mar 26, 8:53 am, "Aidy" <> wrote:
    > 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.
    >
    > "S_K" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > 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- Hide quoted text -

    >
    > - 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?
     
    S_K, Mar 26, 2008
    #4
  5. 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/
    ======================================
    "S_K" <> wrote in message
    news:...
    On Mar 26, 8:53 am, "Aidy" <> wrote:
    > 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.
    >
    > "S_K" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > 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- Hide quoted text -

    >
    > - 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, Mar 26, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roger Twomey
    Replies:
    1
    Views:
    12,664
    Roger Twomey
    Apr 27, 2004
  2. Roberto Lopes
    Replies:
    1
    Views:
    2,223
    mahere
    Dec 27, 2007
  3. =?Utf-8?B?bGFuZW0=?=

    Reading an excel spreadsheet using ado.net

    =?Utf-8?B?bGFuZW0=?=, Jun 21, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    757
    Mark Rae
    Jun 21, 2006
  4. nicelily

    reading input from excel spreadsheet

    nicelily, Mar 5, 2007, in forum: C Programming
    Replies:
    0
    Views:
    359
    nicelily
    Mar 5, 2007
  5. Krishna Vutukuru

    reading values from an excel spreadsheet

    Krishna Vutukuru, Oct 11, 2007, in forum: Ruby
    Replies:
    3
    Views:
    107
    Liang He
    Oct 11, 2007
Loading...

Share This Page