SSIS Packet and Excel Sheet from dot Net in C#

  • Hi All

    I am working on ssis package Excel sheet c#

    I have Excel spread sheet on my desk top with some data

    I wanted to load all the exceldata to database table through SSIS package

    SSIS package is Done

    How do i call SSIS package and Excel sheet from dot net code and save it in a table

    Send me some sample code

    thanks in advance

  • Hi,

    It's quite simple, first you have to load the package and then execute it - that's it 🙂

    Example:

    Microsoft.SqlServer.Dts.Runtime.Application app =

    new Microsoft.SqlServer.Dts.Runtime.Application();

    Package package;

    ...

    package = app.LoadPackage(packageFile, null);

    DTSExecResult result = package.Execute(null, null, null, null, null);

    if (result != DTSExecResult.Success)

    {

    foreach (DtsError error in package.Errors)

    {

    this.LogError(error, error.ErrorCode, error.SubComponent, error.Description);

    }

    package.Errors.Clear();

    }

    HTH

    *-- robert.oh. --*

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply