Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to import from Excel to SQL Server using SSIS through code and used the following connection information.
C#
connectionManager = package.InnerObject.Connections.Add(ExcelMoniker);
connectionManager.Properties["ConnectionString"].SetValue(connectionManager, string.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0;HDR=YES""", excelDataSource.FileName)); 

At the time of AcquireConnections method calling it is throwing an exception
"Exception from HRESULT: 0xC020801E"
The connection manager "__" is an incorrect type. The type required is "__". The type available to the component is "__".


Please help.

Regards,
hari.
Posted
Updated 11-May-16 5:27am
v2

1 solution

My guess is that you didn't install the office 2007 data connectivity components...

http://www.microsoft.com/downloads/details.aspx?familyid=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en[^]


Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900