Can anybody tell me correct syntax

  • Hi,

    I am new to SSIS.I defined ReadOnlyVariables "FileName".In script it is showing the following error,which is shown in attachment.Please tell me correct syntax.

    Thanks in advance

  • Can you provide more details as to what you are trying to accomplish?

  • User::FileName

    and it's case-sensitive.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • public void Main()

    {

    Variables var = null;

    if (Dts.Variables.Contains("FileName") == true)

    {

    // Dts.VariableDispenser.LockOneForRead["FileName", var);

    Dts.VariableDispenser.LockOneForRead("FileName",var );

    }

    MessageBox.Show("Found the file: "+var["FileName"].Value.ToString());

    Dts.TaskResult = (int)ScriptResults.Success;

    }

  • elchuru (1/2/2010)


    public void Main()

    {

    Variables var = null;

    if (Dts.Variables.Contains("FileName") == true)

    {

    // Dts.VariableDispenser.LockOneForRead["FileName", var);

    Dts.VariableDispenser.LockOneForRead("FileName",var );

    }

    MessageBox.Show("Found the file: "+var["FileName"].Value.ToString());

    Dts.TaskResult = (int)ScriptResults.Success;

    }

    This is the correct syntax:

    Dts.VariableDispenser.LockOneForRead( "FileName", ref var );

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Its working fine

    Thanks CozyRoc

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply