Hi all,
I have a curious problem I was hoping someone could help me with.
I've designed a package to perform some data warehousing of our DB's. It manages to run successfully in Visual Studio (/BIDS) with no problems, including using various XML configurations for our different environments (Local, Dev, Test).
We've then tried to trigger the execution of the package from our ASP.Net web application. The first time after a system reboot, the package runs successfully. However, subsequent attempts fail with an array of the following error message for each of the package's variables:
Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/ : The result of the expression "@[User::ReportMasterName]" on property "SourceDatabaseName" cannot be written to the property. The expression was evaluated, but cannot be set on the property.
Here are the relevant pieces of code:
Web.Config:
<add key="SnapshotPackagePath" value="C:\...\pkgExecuteMonthlySnapshot.dtsx" />
<add key="SnapshotConfigPath" value="C:\...\snapshot-connsettings.dtsconfig" />
public void load() _listener = new PackageEvents(); switch (_loadType) if (_configPath != null)
{
Application app = new Application();
_listener.PtrUpdateStatus = _update;
{
case LoadType.File:
_package = app.LoadPackage(_packagePath, _listener); break;
case LoadType.SQLServer:
_package = app.LoadFromSqlServer(_packageName, _serverName, _serverUsername, _serverPassword, _listener); break;
default:
throw new Exception(this.ToString() + ".load() - Unable to load package. Could not determine load type.");
}
{
if (!File.Exists(_configPath))
throw new FileNotFoundException(this.ToString() + ".load() - Unable to load package. Configuration file not at location specified.", _configPath);
_package.ImportConfigurationFile(_configPath);
}
}
public bool execute(ref string strReturn) result = _package.Execute(null, null, _listener, null, null); strReturn += String.Concat(result.ToString(), " "); if (result == DTSExecResult.Failure)
{
DTSExecResult result;
//result = _package.Execute();
{
foreach (DtsError errs in _package.Errors)
strReturn += String.Concat(errs.Description, " ");
}
}
We've attemped to execute this both as a file system package, and as a SQL Server package.
Any pointers would be greatfully appreciated.
Cheers