locked
Custom Pipelinecomponent and Project/Package Variable RRS feed

  • Question

  • I have custom PipelineComponent written in C# with VS 2012 to send data to Microsoft Dynamics CRM from in-house database as part of ETL.

    Has anyone figured out how to read either a package or project variable in custom component?

    Script component supports passing of variable and it uses ScriptComponent Class 

    I tried 

    IDTSVariables100 variables = null;
                VariableDispenser.LockForRead("Package::CrmServiceAddress");
                VariableDispenser.GetVariables(out variables);
                var serviceAddress = variables[0].Value;
                variables.Unlock();

    The above code give me an Exception, however if I use "System::ContainerStartTime" it works



    Haroon

    Sunday, August 4, 2013 7:42 PM

Answers

  • We call them project or package level parameters and variables could cause confusion.

    To reach parameters refer them as

    $Project::<parameter name> or $Package::<parameter name>

    User:: is used for variables.

    make sure you add variables to readwrite variable list using same names.

    -Dilkush

    • Proposed as answer by Dilkush Patel Monday, August 5, 2013 6:38 AM
    • Marked as answer by Haroon.Said Monday, August 5, 2013 12:32 PM
    Monday, August 5, 2013 6:38 AM

All replies

  • IDTSVariables90 variables = null;

    this.VariableDispenser.LockForRead("User::dimSrcId");

    this.VariableDispenser.GetVariables(out variables);

    dimSrcId = variables["User::dimSrcId"].Value.ToString();

    variables.Unlock();

    Thanks and Regards, Prajesh Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Sunday, August 4, 2013 8:05 PM
  • What's the exception message?

    Is it a Sensitive Parameter?

    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter

    Monday, August 5, 2013 6:16 AM
  • We call them project or package level parameters and variables could cause confusion.

    To reach parameters refer them as

    $Project::<parameter name> or $Package::<parameter name>

    User:: is used for variables.

    make sure you add variables to readwrite variable list using same names.

    -Dilkush

    • Proposed as answer by Dilkush Patel Monday, August 5, 2013 6:38 AM
    • Marked as answer by Haroon.Said Monday, August 5, 2013 12:32 PM
    Monday, August 5, 2013 6:38 AM
  • You did'nt read my question. Not useful.

    Haroon

    Monday, August 5, 2013 12:29 PM
  • Thanks, I guess I was missing the "$" before $Package or $Project.

    Haroon

    Monday, August 5, 2013 12:33 PM
  • Just saw that you were using "Package::"

    Sorry for confusion.

    -Dilkush

    • Proposed as answer by Dilkush Patel Wednesday, August 7, 2013 6:28 AM
    Wednesday, August 7, 2013 6:28 AM