Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Execute SSIS SQL2008R2 Package on Visual Studio 2010 Win Aplication

$
0
0

Hi 

I have create SSIS package from BIDS 2008, and its working fine when executing at BIDS studio as well on SQL Job.

But my requirement is to call the SSIS package from Win Form , so I have create simple Win Application from Visual Studio 2010 which will execute SSIS package run time using ( Microsoft.SqlServer.Dts.Runtime;) DLL.

I have added DLL reference from (C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll)

 private void BtnExecuteSSIS_Click(object sender, EventArgs e)
        {
            try
            {
                                  Package pkg;
                    Microsoft.SqlServer.Dts.Runtime.Application app;
                    DTSExecResult pkgResults;

                    app = new Microsoft.SqlServer.Dts.Runtime.Application();
                    
                    pkg = app.LoadPackage("D:\SSIS\DataMigration.dtsx", null);


                    Status = pkg.Execute();

                    pkg.Dispose();

                    MessageBox.Show(Status);
                }

            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message,"",MessageBoxButtons.OK, MessageBoxIcon.Error); 
            }
        }

When i am trying to runn from VS 2010 studion it crashes as in below images

Error


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>