1
votes

I am generating SSIS packages with BIML and I am setting up my FTPConnection like this:

<FtpConnection Name="FTP" ServerName="srv003809" Password="" ServerPort="21" UsePassiveMode="true" >
    <Expressions>
        <Expression PropertyName="ServerName">@[User::mst_strFTP_Server]</Expression>
        <Expression PropertyName="ServerPort">@[User::mst_strFTP_Port]</Expression>
        <Expression PropertyName="ServerUserName">@[User::mst_strFTP_Username]</Expression>     
        <Expression PropertyName="ServerPassword">@[User::mst_strFTP_Password]</Expression> 
    </Expressions>
</FtpConnection>

When I generate the package I get this error:

Could not resolve reference to 'ServerPassword' of type 'PropertyExpression'. 'PropertyName="ServerPassword"' is invalid.
Provide valid scoped name

I have tried changing ServerPassword to Password without success. I can't find much on the BIML forums in connection with FTP connections.

How do I set the FTP connection password using an expression in BIML?

I am using Visual Studio 2010 and BIDSHelper 2012 (1.7.0.0)

1
Couple of thoughts... I think you'll have to change the 'Connection' property, not the individual components. Other thought is, since it's BIML, can you offload those variables into BIML control blocks as C# vars, and then access it in a BIML expression block? And finally, can you utilize this answer to create a Script Task?sorrell
Thanks @sorrell I finally got around to trying your suggestions. Setting the "connection" or "ConnectionString" doesn't seem to work, but using a script task does the job - seems a bit heavy handed, but it works.Sean

1 Answers

1
votes

Instead of using the PropertyName, try using ExternalProperty. I was having a similar problem using variables and expressions using an Odbc connection, and changing it to ExternalProperty="Password" and ExternalProperty="UserName" worked for me.

I am still looking for the difference between Property and ExternalProperty, and will post once I am able to find something.