开发者

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:

  1. Add Your_Variable in the script component. (Right click --> Edit --> Script --> ReadOnlyVariables).

  2. Dim variableString As String = Me.ReadOnlyVariables("User::Your_Variable").Value.ToString().


Try adding;

Imports Microsoft.SqlServer.Dts


Try me.Connections and me.Variables

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜