Executing SSIS package programmatically using C#

0

I writing to execute SSIS package using the application. I have written following code but it gives an error. the error is listed below the code.

        public void RunPackage()
    {
        string pkgLocation;
        Package pkg;
        Application app;
        DTSExecResult pkgResults;

        pkgLocation = @"C:\Users\EMISDb\Desktop\NEOC\EOC data need\NEOC_ETL\NEOC_ETL\obj\Development\99_Dash_WHO.dtsx";
        app = new Application();
        pkg = app.LoadPackage(pkgLocation, null);
        pkgResults = pkg.Execute();

    }

error:

Retrieving the COM class factory for component with CLSID {4F0FC44B-C99C-4 41D-B86A-D60D7E22143D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {4F0FC44B-C99C-441D-B86A- D60D7E22143D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

The error at the following line.

Line 27:             app = new Application();
c#
sql-server
ssis
etl
asked on Stack Overflow Feb 26, 2018 by Hafizullah Mahmudi • edited Feb 26, 2018 by Hadi

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0