I'm trying to pass a dynamic file path to a SSIS package variable. I'm setting the ConnectionString value to the variable value in the connection expressions.
So to get started I set the initial variable name value to products.csv and get the error:
Nonfatal errors occurred while saving the package: The name cannot contain any of the following characters: / \ : [ ] . =

I remove the .csv from the variable name, since I'm passing this value from code anyways - no biggie. But when I pass the appropriate variables and execute the package I get weirdness. I check the db and the expected values from the package are there, but I get a failure status and errors similar to the one I mentioned above.
Below is my code:
GeneralUtilities.ExecutePackage(
new ListDictionary()
{
{"ClientId", Client.Id},
{"FileName", ConfigurationManager.AppSettings["DownloadLocation"] + @"\" + this.OriginalName}
},
"Products.dtsx");
public static void ExecutePackage(ListDictionary variables, string packageName)
{
string pkgLocation;
Package pkg;
Application app;
DTSExecResult pkgResults;
Variables vars;
pkgLocation = ConfigurationManager.AppSettings["PackageLocation"] + packageName;
app = new Application();
using (pkg = app.LoadPackage(pkgLocation, null))
{
vars = pkg.Variables;
foreach (DictionaryEntry variable in variables)
{
vars[variable.Key].Value = variable.Value;
}
pkgResults = pkg.Execute(null, vars, null, null, null);
for(int i=0;i<pkg.Errors.Count;i++)
Console.WriteLine(pkg.Errors[i].Description);
Console.WriteLine(pkgResults.ToString());
}
}
And here's the output:

It's cool that it's being input into the db, but I don't think the Failure message will work. Seems like a package setting or something that is causing a 'false failure'. Can anyone provide help? Thanks.


products.csvI'll look at your code after my boys are in bed