Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

The type of the value being assigned to variable differs from the current variable type

$
0
0

I'm trying to execute:

            var DrgFileDir = Directory.GetFiles(@"C:\Source", "Drg*.txt");
            if (DrgFileDir != null)
            {
                Dts.Variables["DrgFileName"].Value = DrgFileDir;
            }

I'm getting following error: 

Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The type of the value being assigned to variable "User::DrgFileName" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
 ---> System.Runtime.InteropServices.COMException (0xC001F009): The type of the value being assigned to variable "User::DrgFileName" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.

"DrgFileName" is String Variable in SSIS package.


ZK


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>