troubleshooting Question

executing SSIS 2008 package from asp.net -- ACCESS DENIED

Avatar of robespierre_2010
robespierre_2010 asked on
Microsoft SQL ServerASP.NETMicrosoft SQL Server 2008
3 Comments1 Solution493 ViewsLast Modified:
Hi,

I am using the below code to run an SSIS package from as ASP.net web site. When I do I get an acess denied error. The web site cannot access a folder (see attached doc for a screenshot). Obviously it has to do with permissions. Now, what would be the way to solve it? What is the account that the asp.net web site uses to access this folder?

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.SqlServer.Dts.Runtime;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
 
    protected void btnExecute_Click(object sender, EventArgs e)
    {
        Application app = new Application();
        Package package = null;
        try
        {
            string fileName = Server.MapPath(System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName.ToString()));
            FileUpload1.PostedFile.SaveAs(fileName);
            
            //Load DTSX
            package = app.LoadPackage(@"C:\Users\Administrator\Documents\Visual Studio 2008\projects\Integration Services Project1\Integration Services Project1\Package.dtsx", null);
            
            //Global Package Variable
            Variables vars = package.Variables;
            vars["Business_ID"].Value = txtBusinessID.Text;
            vars["Business_Name"].Value = txtBusinessName.Text;
            
            //Specify Excel Connection From DTSX Connection Manager
            package.Connections["PRUEBASSOURCE"].ConnectionString = "C:\\Users\\Administrator\\Desktop\\SSISASPNET\\PRUEBAS\\PRUEBASSOURCE\\PRUEBASSOURCE.txt";
            
            //Execute DTSX.
            Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            package.Dispose();
            package = null;
        }
    }
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros