Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SSIS Connection Problem in C#

SSIS Connection Problem in C#

Scheduled Pinned Locked Moved Database
databasesql-serversysadminhelpcsharp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vimalsoft Pty Ltd
    wrote on last edited by
    #1

    Goood Day All I have a SSIS package that i have created and i want to execute in C# in my web Application. and i have a Connection manager named "OMEGA" and in my C# am trying to execute it like this

    //Start the SSIS Here
    Application app = new Application();
    Package package = null;
    package = app.LoadPackage(@"C:\O!WEB_SETUP_VERSIONS\SSIS_Compiled\OMEGA.dtsx", null);
    Variables vars = package.Variables;
    vars["Time1"].Value = time;
    vars["Time2"].Value = time;
    vars["Time3"].Value = time;
    vars["TTBLTYPE"].Value = THREAD_DATA[1].ToString();

    ConnectionManager Omega = package.Connections.Add("OLEDB");
    Omega.Name = "OLEDBConnection";
    String Strcon = obj.GetConnectionString(THREAD_DATA[0].ToString());
    Omega.ConnectionString = Strcon;

    //package.Connections["SQLNCLI10.1"].ConnectionString = obj.GetConnectionString(THREAD_DATA[0].ToString());
    //Excute Package
    Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
    String Log;

    if (results == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
    {
    foreach (Microsoft.SqlServer.Dts.Runtime.DtsError local_DtsError in package.Errors)
    {
    // Log = local_DtsError.Description.ToString();

    //CommonFunctions.writeLogFile(Log,true);

    }
    }

    }

    After it executed the package, when i loop through the exceptions i get this

    SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.\r\nAn OLE DB record is available. Source: \"Microsoft SQL Server Native Client 10.0\" Hresult: 0x80004005 Description: \"Login timeout expired\".\r\nAn OLE DB record is available. Source: \"Microsoft SQL Server Native Client 10.0\" Hresult: 0x80004005 Description: \"A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.\".\r\nAn OLE DB record is available. Source: \"Microsoft SQL Server Native Client 10.0\" Hresult: 0x80004005 Description: \"TCP Provider: No connection could be made because the target machine actively refused it.\r\n\".\r\n

    Please note that i want to use my webconfig not SSIS Config. in the Function GetConnectionString i return a Connection string and Pass it to the package. Thanks

    Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal c

    R 1 Reply Last reply
    0
    • V Vimalsoft Pty Ltd

      Goood Day All I have a SSIS package that i have created and i want to execute in C# in my web Application. and i have a Connection manager named "OMEGA" and in my C# am trying to execute it like this

      //Start the SSIS Here
      Application app = new Application();
      Package package = null;
      package = app.LoadPackage(@"C:\O!WEB_SETUP_VERSIONS\SSIS_Compiled\OMEGA.dtsx", null);
      Variables vars = package.Variables;
      vars["Time1"].Value = time;
      vars["Time2"].Value = time;
      vars["Time3"].Value = time;
      vars["TTBLTYPE"].Value = THREAD_DATA[1].ToString();

      ConnectionManager Omega = package.Connections.Add("OLEDB");
      Omega.Name = "OLEDBConnection";
      String Strcon = obj.GetConnectionString(THREAD_DATA[0].ToString());
      Omega.ConnectionString = Strcon;

      //package.Connections["SQLNCLI10.1"].ConnectionString = obj.GetConnectionString(THREAD_DATA[0].ToString());
      //Excute Package
      Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute();
      String Log;

      if (results == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
      {
      foreach (Microsoft.SqlServer.Dts.Runtime.DtsError local_DtsError in package.Errors)
      {
      // Log = local_DtsError.Description.ToString();

      //CommonFunctions.writeLogFile(Log,true);

      }
      }

      }

      After it executed the package, when i loop through the exceptions i get this

      SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.\r\nAn OLE DB record is available. Source: \"Microsoft SQL Server Native Client 10.0\" Hresult: 0x80004005 Description: \"Login timeout expired\".\r\nAn OLE DB record is available. Source: \"Microsoft SQL Server Native Client 10.0\" Hresult: 0x80004005 Description: \"A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.\".\r\nAn OLE DB record is available. Source: \"Microsoft SQL Server Native Client 10.0\" Hresult: 0x80004005 Description: \"TCP Provider: No connection could be made because the target machine actively refused it.\r\n\".\r\n

      Please note that i want to use my webconfig not SSIS Config. in the Function GetConnectionString i return a Connection string and Pass it to the package. Thanks

      Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal c

      R Offline
      R Offline
      R Giskard Reventlov
      wrote on last edited by
      #2

      1: Is the connection string correct? 2: Do you have the requisite permissions? 3: Check the SQL configuration via the Sql Server Configuration Manager (was called somehting else in 2005: maybe Surface Area something or other) and ensure that it is set up correctly for your installation. 4: AS I recall the error you have listed is quite common: a quick search on Google would yield plenty of results. Here is one I found in about a second: TCP Provider: No connection could be made because the target machine actively refused it [^].

      Tychotics: take us back to the moon "Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars." H. G. Wells

      V 1 Reply Last reply
      0
      • R R Giskard Reventlov

        1: Is the connection string correct? 2: Do you have the requisite permissions? 3: Check the SQL configuration via the Sql Server Configuration Manager (was called somehting else in 2005: maybe Surface Area something or other) and ensure that it is set up correctly for your installation. 4: AS I recall the error you have listed is quite common: a quick search on Google would yield plenty of results. Here is one I found in about a second: TCP Provider: No connection could be made because the target machine actively refused it [^].

        Tychotics: take us back to the moon "Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars." H. G. Wells

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        1: The connection string is Correct it comes from my webconfig 2: Can you give me more info on this one. Thanks 3: what Configuration needs to be there ? i have SQl 2005 installed and 2008 installed they both use the same port 4: i saw that links and i have Googled Thanks

        Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups