locked
display data in excel 2007 RRS feed

  • Question

  • User1761849360 posted

     I am using .net  version 1.1  and  excel 2003 to display data.I need to display data in 2007 .Can  anyone suggest the reference to be added ,connection string change and what should be imported.  

    Saturday, August 14, 2010 2:48 PM

Answers

  • User-660870441 posted

    Hi,

    Welcome to ASP.NET.

    As far as I know, the reference is the same and also not need to import other namespace. And the only thing you need to do is changing the connection string, because Excel 2003 uses Microsoft.Jet.OLEDB.4.0 as provider but Excel 2007 uses Microsoft.ACE.OLEDB.12.0 as provider.

    Here are two reference articles which describe about how to read Microsoft Excel 2007 in C# (I assumed you are using C#).

    # Reading Excel 2003 and 2007 Files Using OLEDB
    http://codehill.com/2009/01/reading-excel-2003-and-2007-files-using-oledb/

    # How to Read Microsoft Excel 2007 Using a Connection String in C#
    http://www.codeproject.com/KB/database/ReadExcel07.aspx

    Hope this helps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 17, 2010 3:36 AM

All replies

  • User-2005691517 posted

    In case you are just exporting a webpage as excel, you do not need to do any change since Excel 2007 will be able to open it (*.xls)

    If you are doing something else with Excel, post more details.

    Saturday, August 14, 2010 7:18 PM
  • User-660870441 posted

    Hi,

    Welcome to ASP.NET.

    As far as I know, the reference is the same and also not need to import other namespace. And the only thing you need to do is changing the connection string, because Excel 2003 uses Microsoft.Jet.OLEDB.4.0 as provider but Excel 2007 uses Microsoft.ACE.OLEDB.12.0 as provider.

    Here are two reference articles which describe about how to read Microsoft Excel 2007 in C# (I assumed you are using C#).

    # Reading Excel 2003 and 2007 Files Using OLEDB
    http://codehill.com/2009/01/reading-excel-2003-and-2007-files-using-oledb/

    # How to Read Microsoft Excel 2007 Using a Connection String in C#
    http://www.codeproject.com/KB/database/ReadExcel07.aspx

    Hope this helps.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 17, 2010 3:36 AM