Configuration from a parent variable "ServerName" did not occur because there was no parent variable collection or Edit the existing Package Configurations using C#
-
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