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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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