简体   繁体   中英

dynamic datatype not working in SSIS script task

I declared a variable as below in script task

dynamic sqldata = Dts.Variables["User::sqldata"].Value;

When I try to click OK for script task component, error coming as below

在此处输入图片说明

But when I replace dynamic keyword with object or var , which works fine.

So why dynamic datatype not working in script task?

stumbled across query when I had this same error myself so I thought I'd share my findings. My solution was to add Microsoft.CSharp as a reference when editing the script.

  1. Edit the script component in the dataflow
  2. Edit the script
  3. Right click on References in the Solution Explorer
  4. Add the reference "Microsoft.CSharp"
  5. Use it in your class - Using Microsoft.CSharp;

Hope that helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM