Domanda

This is what I'm trying to do in a script task:

long lngMaxRowsToPull = Convert.ToInt64(Dts.Variables["Project::MaxRowsPerPull"].Value);

I get an error message that the variable does not exist.

Yet Its defined as a ReadOnlyVariable to the script and it does exist as a project parameter.

Its defined as a ReadOnlyVariable to the script

And it does exist as a project parameter

È stato utile?

Soluzione

So close. ;)

Your code is trying to access a variable/parameter named Project::MaxRowsPerPull

In fact, the $ is significant so you need to reference $Project::MaxRowsPerPull

Also note that you have the data type for the parameter as Int32 but are then pushing it into Int64. You can always put a smaller type into a larger container but if you tried to fill the parameter with too large a value your package will asplode.

Altri suggerimenti

You need to add $ to your parameter fetch name as per syntax.

long lngMaxRowsToPull = Convert.ToInt64(Dts.Variables["$Project::MaxRowsPerPull"].Value);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top