Click here to Skip to main content
15,915,057 members
Home / Discussions / Database
   

Database

 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Chris Quinn2-Nov-16 3:14
Chris Quinn2-Nov-16 3:14 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Eddy Vluggen2-Nov-16 4:03
professionalEddy Vluggen2-Nov-16 4:03 
AnswerRe: What should I write in Timeout Attribute to achieve maximum timeout limit? (Asp.net) Pin
Basit Shah Syed18-Nov-16 2:47
Basit Shah Syed18-Nov-16 2:47 
QuestionUse Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 9:41
Django_Untaken1-Nov-16 9:41 
AnswerRe: Use Conditions In Query [MySQL] Pin
ZurdoDev1-Nov-16 10:04
professionalZurdoDev1-Nov-16 10:04 
AnswerRe: Use Conditions In Query [MySQL] Pin
Richard Deeming1-Nov-16 10:24
mveRichard Deeming1-Nov-16 10:24 
QuestionRe: Use Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 19:54
Django_Untaken1-Nov-16 19:54 
AnswerRe: Use Conditions In Query [MySQL] Pin
Richard Deeming2-Nov-16 2:51
mveRichard Deeming2-Nov-16 2:51 
AnswerRe: Use Conditions In Query [MySQL] Pin
phil.o1-Nov-16 14:01
professionalphil.o1-Nov-16 14:01 
GeneralRe: Use Conditions In Query [MySQL] Pin
Django_Untaken1-Nov-16 19:45
Django_Untaken1-Nov-16 19:45 
GeneralRe: Use Conditions In Query [MySQL] Pin
phil.o1-Nov-16 21:19
professionalphil.o1-Nov-16 21:19 
QuestionExtending SSIS components Pin
Rahul_Biswas26-Oct-16 19:11
professionalRahul_Biswas26-Oct-16 19:11 
QuestionRecursive CTE in T-SQL Pin
Rahul_Biswas24-Oct-16 22:15
professionalRahul_Biswas24-Oct-16 22:15 
AnswerRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 0:18
mveRichard MacCutchan25-Oct-16 0:18 
GeneralRe: Recursive CTE in T-SQL Pin
Rahul_Biswas25-Oct-16 0:44
professionalRahul_Biswas25-Oct-16 0:44 
GeneralRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 0:51
mveRichard MacCutchan25-Oct-16 0:51 
GeneralRe: Recursive CTE in T-SQL Pin
Rahul_Biswas25-Oct-16 0:58
professionalRahul_Biswas25-Oct-16 0:58 
GeneralRe: Recursive CTE in T-SQL Pin
Richard MacCutchan25-Oct-16 1:08
mveRichard MacCutchan25-Oct-16 1:08 
QuestionWhy SQL server maintenance plan Cannot rebuild clustered index offline? Pin
cornpoppy24-Oct-16 0:11
cornpoppy24-Oct-16 0:11 
AnswerRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
Eddy Vluggen25-Oct-16 0:37
professionalEddy Vluggen25-Oct-16 0:37 
GeneralRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
cornpoppy25-Oct-16 18:50
cornpoppy25-Oct-16 18:50 
GeneralRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
Eddy Vluggen25-Oct-16 22:17
professionalEddy Vluggen25-Oct-16 22:17 
AnswerRe: Why SQL server maintenance plan Cannot rebuild clustered index offline? Pin
Richard Deeming26-Oct-16 3:23
mveRichard Deeming26-Oct-16 3:23 
QuestionConfiguration from a parent variable "ServerName" did not occur because there was no parent variable collection or Edit the existing Package Configurations using C# Pin
indian14321-Oct-16 12:12
indian14321-Oct-16 12:12 
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 ConName = connection.Name;

                    if (ConnectionCollection.Contains(ConName))
                    {
                        connection.ConnectionString =
                            ConnectionCollection[ConName].ToString();
                    }
                }
            }
        }
    }
    catch (Exception ex)
    {
        _Status = DTSPackageStatus.LoadFailed;

        throw ex;
    }
}

public void SetPakageVariables(System.Collections.Hashtable VariableCollection)
{
    try
    {
        if (_Status == DTSPackageStatus.Loaded)
        {
            Variables variables = _Pkg.Variables;
            if ((VariableCollection != null) && (variables != null))
            {
                for (int Idex = 0; Idex < variables.Count; Idex++)
                {
                    Variable variable = variables[Idex];
                    string VarName = variable.Name;

                    if (VariableCollection.Contains(VarName))
                    {
                        bool IsReadOnly = (bool)variable.Properties["ReadOnly"].GetValue(variable);
                        if (!IsReadOnly)
                            variable.Value =
                                VariableCollection[VarName].ToString();
                    }
                }
            }
        }
    }
    catch (Exception ex)
    {
        _Status = DTSPackageStatus.LoadFailed;
        throw ex;
    }
}
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."


modified 21-Oct-16 20:20pm.

QuestionVisual Studio Database Projects and General Use Pin
cjb11018-Oct-16 2:38
cjb11018-Oct-16 2:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.