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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Configuration from a parent variable "ServerName" did not occur because there was no parent variable collection or Edit the existing Package Configurations using C#

Configuration from a parent variable "ServerName" did not occur because there was no parent variable collection or Edit the existing Package Configurations using C#

Scheduled Pinned Locked Moved Database
questioncsharpdatabasesql-serversysadmin
1 Posts 1 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.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi, I am executing an SSIS package using my C# code, its saying package executing successfully but unfortunately when I checking in the database, it is not putting the values into that Server, in between the execution I am getting a Warning that "Configuration from a parent variable "ServerName" did not occur because there was no parent variable collection.", if really package is having issues in connections and variables, how can I set the variable values differently than below, below is the code how I am setting the Package connections and Variables. It seems that package is using some configurations, is there any way I can modify the existing package configurations at run time using C# code? I don't want to add new configurations to package but want to edit the existing ones to match my needs. Here is the code, any help would be very very helpful for me thanks in advance my friends.

        public void SetRetainSameConnection()
        {
            try
            {
                if (\_Status == DTSPackageStatus.Loaded)
                {
                    Connections connections = \_Pkg.Connections;
    
                    if (connections != null)
                    {
                        for (int Idex = 0; Idex < connections.Count; Idex++)
                        {
                            ConnectionManager connection = connections\[Idex\];
    
                            if (connection.Properties.Contains("RetainSameConnection"))
                                connection.Properties\["RetainSameConnection"\].SetValue(connection, true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                \_Status = DTSPackageStatus.LoadFailed;
                throw ex;
            }
        }
        public void SetPakageConnections(System.Collections.Hashtable ConnectionCollection)
        {
            try
            {
                if (\_Status == DTSPackageStatus.Loaded)
                {
                    Connections connections = \_Pkg.Connections;
    
                    if ((ConnectionCollection != null) && (connections != null))
                    {
                        for (int Idex = 0; Idex < connections.Count; Idex++)
                        {
                            ConnectionManager connection = connections\[Idex\];
    
                            //connection.Properties\["RetainSameConnection"\].SetValue(connection, true);
    
                            string Co
    
    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