locked
Execute SSIS Package Using ASP.Net RRS feed

  • Question

  • User-1128085 posted

    Description Of Environment

    I have an SSIS task which executes from asp.net, the package gets data from excel files over UNC path and puts the data into a sql server databaase . I have deployed the SSIS to file system, it has windows authentication database connections and the IIS user has database access. I can log in as the AppPoolUser I have used to host the web application and open/modify the files in question so those basic permissions are there. Web App is compiled in x86.

    When it works:

    • When run from Visual Studio (ctrl + shift + W) it works fine and every thing is done succefuly.

    When it doesn't work:

    • When run from client browser. it upload the file but fail in the package.

    My Question

    What is different about the client and server and how do I make it work? I was under the impression that when running the web app all connections go through the AppPool User so it should behave the same on any machine server included?

    c# Code running SSIS Package

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Microsoft.SqlServer.Dts.Runtime;
    
    public partial class Pages_Quality : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void Upload_Click(object sender, EventArgs e)
        {
            if (FileUpload1.HasFile)
            {
                string fileExt =
                   System.IO.Path.GetExtension(FileUpload1.FileName);
    
                if (FileUpload1.FileName == "Breached.xlsx")
                {
                    try
                    {
                        FileUpload1.SaveAs("*:\\***\\***\\" +
                           FileUpload1.FileName);
                        Label1.Text = "Upload Done";
    
                        Application app = new Application();
                        Package package = app.LoadPackage(@"*:\**\**\Quality.dtsx", null);
        
                       DTSExecResult result = package.Execute();
                       
                        Label2.Text = (result.ToString());
                    }
                    catch (Exception ex)
                    {
                        Label1.Text = "ERROR: " + ex.Message.ToString();
                    }
                }
                else
                {
                    Label1.Text = "Only Breached.xls is allowed!";
                }
            }
            else
            {
                Label1.Text = "You have not specified a file.";
            }
        }
    }



    Friday, September 6, 2013 6:15 AM

Answers

All replies