Reading data from an Excel spreadsheet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • S_K

    Reading data from an Excel spreadsheet

    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.Odb c.OdbcFactory
    System.Data.Ole Db.OleDbFactory
    System.Data.Sql Client.SqlClien tFactory

    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

    #2
    Re: Reading data from an Excel spreadsheet

    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" <steve_kershaw@ yahoo.comwrote in message
    news:9513772c-3a69-491a-a4e7-0cf2efcafa5a@e2 3g2000prf.googl egroups.com...
    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.Odb c.OdbcFactory
    System.Data.Ole Db.OleDbFactory
    System.Data.Sql Client.SqlClien tFactory
    >
    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

    Comment

    • Cowboy \(Gregory A. Beamer\)

      #3
      Re: Reading data from an Excel spreadsheet

      David is using the Enterprise Library. You can download it from:


      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


      or just read it:


      *************** *************** *************** ****
      | Think outside the box!
      |
      *************** *************** *************** ****
      "S_K" <steve_kershaw@ yahoo.comwrote in message
      news:9513772c-3a69-491a-a4e7-0cf2efcafa5a@e2 3g2000prf.googl egroups.com...
      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.Odb c.OdbcFactory
      System.Data.Ole Db.OleDbFactory
      System.Data.Sql Client.SqlClien tFactory
      >
      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

      Comment

      Working...