Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am trying to import an excel file to SQL Server database using SSIS in asp.net web app. My code is working when running as local host. when hosted the same code in IIS, Its not working. Giving Error Msg

Exception Details: System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xC020801C

MSIL
Line 188:
Line 189:            // establish a connection
Line 190:            managedFlatFileInstance.AcquireConnections(null);
Line 191:            // Initialize the metadata
Line 192:            managedFlatFileInstance.ReinitializeMetaData();



MSIL
Stack Trace:

[COMException (0xc020801c): Exception from HRESULT: 0xC020801C]
   Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.AcquireConnections(Object pTransaction) +0
   ImportLib.IntegrationService.Specialized.ExcelFileSource.InitializeDataflowComponent(DataflowComponent sourceDataFlowComponent) in D:\HARI\latest\SSISnew\IntegretionService_src\IntegretionService_src\ImportLib\IntegrationService\Specialized\ExcelFileSource.cs:190
   ImportLib.IntegrationService.Specialized.DataflowManager.CreateDataflowComponents(DTSPackage package, DTSExecutable dataflowTask) in D:\hari\latest\SSISnew\IntegretionService_src\IntegretionService_src\ImportLib\IntegrationService\Specialized\DataflowManager.cs:100
   ImportLib.IntegrationService.Specialized.DataflowManager.CreateDataFlowTask(DTSPackage package) in D:\hari\latest\SSISnew\IntegretionService_src\IntegretionService_src\ImportLib\IntegrationService\Specialized\DataflowManager.cs:79
   ImportLib.IntegrationService.DTSManager.Transfer(ISourceStorage source, IDestinationStorage destination) in D:\HARI\latest\SSISnew\IntegretionService_src\IntegretionService_src\ImportLib\IntegrationService\DTSManager.cs:94
   ImportLib.ImportManager.Transfer(ImportJob job) in D:\HARI\latest\SSISnew\IntegretionService_src\IntegretionService_src\ImportLib\ImportManager.cs:346
   ImportLib.ImportManager.Transfer(String ConnectionString, String IntegratedSecurity, String TemplateName, String FileName, Int16 FileType, String TextQualifier, String ColumnDelimiter, Boolean HasTxtQualifier, Boolean UnixFile, Boolean FirstRowColName, Int32 SkipRows, String& errmsg, String ExcelSheetName, Boolean LookupRowDelimiter, Int16 UseThisRowDelimiter) in D:\HARI\latest\SSISnew\IntegretionService_src\IntegretionService_src\ImportLib\ImportManager.cs:291
   WebImportSSIS._Default.Button1_Click(Object sender, EventArgs e) in D:\HARI\WebImportSSIS\WebImportSSIS\Default.aspx.cs:38
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981



My connection string for excel is:
Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=""EXCEL 8.0;HDR=YES;"";Data Source=" + excelDatasource.FileName;

Can any one please give a good solution.
Thanks

Hari
Posted
Updated 14-Oct-10 0:36am
v2

1 solution

 
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