Fix for Exception when connecting to an Excel .xls file using .NET.?
Posted on 2007-07-24
I am having difficulty connecting to an Excel .xls file (used as a DB source) in .NET.
When I try to connect using .NET and the following connection string I get an exception:
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source = "C:\data.xls; Extended Properties=""Excel 8.0; HDR=YES; """
The exception says that the Microsoft.Jet.OLDDB.4.0 provider is not registered.
I am using VS 2005, and Excel from Microsoft Office 2003.
Does anyone have a fix for this or an alternative solution?
I need to input the data in an Excel file, make changes and then output to an SQL Server 2005 table.