Exception Dts is not declared
I'm getting this (Dts is not declared) exception when I try to build my SSIS script task. Any idea how to resolve it?
here is the part of my 开发者_JS百科code
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Try
Dim cm As ConnectionManager = Dts.Connections.Add("FTP")
cm.Properties("ServerName").SetValue(cm, Dts.Variables("SFTPServerName").Value.ToString)
cm.Properties("ServerUserName").SetValue(cm, Dts.Variables("SFTPLogin").Value.ToString)
cm.Properties("ServerPassword").SetValue(cm, Dts.Variables("SFTPPassword").Value.ToString)
cm.Properties("ServerPort").SetValue(cm, Dts.Variables("SFTPPortNumber").Value.ToString)
This worked for me:
Add
Your_Variable
in the script component. (Right click --> Edit --> Script --> ReadOnlyVariables).Dim variableString As String = Me.ReadOnlyVariables("User::Your_Variable").Value.ToString()
.
Try adding;
Imports Microsoft.SqlServer.Dts
Try me.Connections
and me.Variables
精彩评论