none
Calling SSIS Package from ASP.NET Code RRS feed

  • General discussion

  • HI,

    i have created a web page in asp.net in which i have called a SSIS package....... when i execute the .net page, it runs fine and package executed successfully.

    Now i have to host the web page in IIS Server, for that i have created a webservice under the IIS server, but when i browse the url of the website , it will show "Time Out Expire"........ again i have created another webpage in this i have populated the value of label only and hosted on the IIS server and browse the same, this time it executed successfully, for me it seems problem in executing SSIS package via website url.....

    ASP code when SSIS package is called :

    namespace WebApplication1
    {
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                Main();
               

            }
            public static void Main()
            {

                string pkglocation;
                Package SSISPAckage;
                Application SSISAPP;
                DTSExecResult Result;

                pkglocation = @"D:\SSIS Package\SSIS\SSIS\Package1.dtsx";
                SSISAPP = new Application();
                SSISPAckage = SSISAPP.LoadPackage(pkglocation, null);
                Result = SSISPAckage.Execute();
                Console.WriteLine(Result.ToString());
                Console.Read();
               
               
            }
        }
    }

     

     

    Code when displaying value of Label

     

    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.SqlServer.Dts.Runtime;

    namespace WebApplication1
    {
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                Main();
                
            }
            public static void Main()
            {

                       Label1.Visible = true;
     
                
            }
        }
    }

    Please suggest what should i do to do the same.

     

     

    Amit

    Thursday, March 17, 2011 3:56 PM

All replies

  • Someone else may have more experience.  I will just throw a couple ideas out there. 

    Get rid of the lines of code that call to the console ("Console.WriteLine(Result.ToString());Console.Read();").  I can't image that this code would work without error in a web application.  And if it does work, I would expect the application to wait for user input from the console, a very bad thing in a Web App.

     Does the login that is running the AppDomain for the Web Application have permission to read the package?


    Russel Loski, MCT
    Thursday, March 17, 2011 5:00 PM
  • Does the login that is running the AppDomain for the Web Application have permission to read the package?


    Hi Russ,

    I have ran the web application in visual studio and it executed fine and return result successfully...

    How do i and from where do i check the permission of login that runs the AppDomain for the Web Application to read the package.

     

    Amit


    Friday, March 18, 2011 9:09 AM
  • You need to use the IIS Manager.  I think that I used the wrong term (not AppDomain).  Look at the application pools and find the one that is associated with your ASP.Net application.  One of the properties of the Application Pool is the Identity Property.  You need to make sure that that user has access to the package file.
    Russel Loski, MCT
    Wednesday, March 23, 2011 12:09 PM

  • You can try using SQL server profiler to identify the NTUserName under which the webservice/ssis package is being executed under.
    This depends on how your site is configured and which authentication method is used (anonymous access or authenticated access).
    If you need to limit who can execute the package, you should create a role to access the package and give users permission as required.
    Chaos, Disorder and Panic ... my work is done here!
    Wednesday, March 23, 2011 1:21 PM
  • COZYROC has recently introduced the commercial SSIS NoW module. You can  now implement SSIS package execution from web service address much easier and without requiring to implement single line of code. Cheers!

    SSIS Tasks Components Scripts Services | http://wwww.cozyroc.com/

    Saturday, November 16, 2019 1:51 PM