Dts is not declared Error in Script Task Editor

  • Hi All, When I was trying to write some script in Script Task Editor it is showing "Dts is not declared" error. Can any one help me to sort out this problem.

    Here I have provided my code for your reference.

    Imports System

    Imports System.Data

    Imports System.Math

    Imports Microsoft.SqlServer.Dts.Runtime

    Public Class ScriptMain

    Public Sub Main()

    Dim dayofweek As String = String.Format("[0]dddd", DateTime.Now)

    Dts.Variables("User::DayOfWeek").Value = dayofweek

    Dts.TaskResult = Dts.Results.Success

    End Sub

    End Class

  • Can you try using this.variable("VariableName").value instead of dts? Also, is your variable listed in ReadWriteVariables section of the task?

    :rolleyes:

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply