SSIS VB SCript Task from DTS logic - What am I doing wrong?

I am just getting used to Script tasks and have to convert alot of DTS jobs to SSIS. A lot of the ActiveX can be done in different new tasks but some looks like it still needs code to accomplish. There is obviously somthing I am missing here. I have added the variables to Read/Write  section so that is not a problem. The code is checking the rows downloaded from 2 separate table loads and from there setting other variables that write a table.

#Region "Imports"
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
#End Region

'ScriptMain is the entry point class of the script.  Do not change the name, attributes,
'or parent of this class.
<Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute()> _
<System.CLSCompliantAttribute(False)> _
Partial Public Class ScriptMain
    Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase

#Region "Help:  Using Integration Services variables and parameters in a script"
    'To use a variable in this script, first ensure that the variable has been added to
    'either the list contained in the ReadOnlyVariables property or the list contained in
    'the ReadWriteVariables property of this script task, according to whether or not your
    'code needs to write to the variable.  To add the variable, save this script, close this instance of
    'Visual Studio, and update the ReadOnlyVariables and
    'ReadWriteVariables properties in the Script Transformation Editor window.
    'To use a parameter in this script, follow the same steps. Parameters are always read-only.

    'Example of reading from a variable:
    ' startTime = Dts.Variables("System::StartTime").Value

    'Example of writing to a variable:
    ' Dts.Variables("User::myStringVariable").Value = "new value"

    'Example of reading from a package parameter:
    ' batchId = Dts.Variables("$Package::batchId").Value

    'Example of reading from a project parameter:
    ' batchId = Dts.Variables("$Project::batchId").Value

    'Example of reading from a sensitive project parameter:
    ' batchId = Dts.Variables("$Project::batchId").GetSensitiveValue()
#End Region

#Region "Help:  Firing Integration Services events from a script"
    'This script task can fire events for logging purposes.

    'Example of firing an error event:
    ' Dts.Events.FireError(18, "Process Values", "Bad value", "", 0)

    'Example of firing an information event:
    ' Dts.Events.FireInformation(3, "Process Values", "Processing has started", "", 0, fireAgain)

    'Example of firing a warning event:
    ' Dts.Events.FireWarning(14, "Process Values", "No values received for input", "", 0)
#End Region

#Region "Help:  Using Integration Services connection managers in a script"
    'Some types of connection managers can be used in this script task.  See the topic
    '"Working with Connection Managers Programatically" for details.

    'Example of using an ADO.Net connection manager:
    ' Dim rawConnection As Object = Dts.Connections("Sales DB").AcquireConnection(Dts.Transaction)
    ' Dim myADONETConnection As SqlConnection = CType(rawConnection, SqlConnection)
    ' <Use the connection in some code here, then release the connection>
    ' Dts.Connections("Sales DB").ReleaseConnection(rawConnection)

    'Example of using a File connection manager
    ' Dim rawConnection As Object = Dts.Connections("").AcquireConnection(Dts.Transaction)
    ' Dim filePath As String = CType(rawConnection, String)
    ' <Use the connection in some code here, then release the connection>
    ' Dts.Connections("").ReleaseConnection(rawConnection)
#End Region

    'This method is called when this script task executes in the control flow.
    'Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
    'To open Help, press F1.

    Public Sub Main()
        Dts.Variables("User::GV_PKG_ST").Value = "C"
        Dts.Variables("User::MF_UPD_ST").Value = "I"
        Dts.Variables("User::GV_RowCount").Value = CInt(Dts.Variables("User::GV_IB_COUNT").Value) + CInt(Dts.Variables("User::GV_INV_COUNT").Value)
        If (Dts.Variables("User::GV_LASTDNLDLOGMARKER").Value Is "                          ") Then
            Dts.Variables("User::MF_UPD_ST").Value = "C"
            Dts.Variables("User::GV_MSG").Value = "No Rows To Process"
        Else : Dts.Variables("User::GV_MSG").Value = "Process Complete"
        End If

        Dts.TaskResult = ScriptResults.Success

    End Sub

#Region "ScriptResults declaration"
    'This enum provides a convenient shorthand within the scope of this class for setting the
    'result of the script.

    'This code was generated automatically.
    Enum ScriptResults
        Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
        Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
    End Enum

#End Region

End Class
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel ReynoldsSoftware Applications Developer / IntegratorCommented:
I don't see where you would actually be doing anything other than checking the value of the GV_LASTDNLDLOGMARKER. and it appears it is doing that incorrectly by using the "Is" keyword instead of the "=" sign. (bolded below)
The logic is as follows:
1) set variables
2) check if GV_LASTDNLDLOGMARKER = "          "
3) if match set 2 variables
4) if not match we are complete
5) no matter what, set status = success

 Public Sub Main()
         Dts.Variables("User::GV_PKG_ST").Value = "C"
         Dts.Variables("User::MF_UPD_ST").Value = "I"
         Dts.Variables("User::GV_RowCount").Value = CInt(Dts.Variables("User::GV_IB_COUNT").Value) + CInt(Dts.Variables("User::GV_INV_COUNT").Value)
         If (Dts.Variables("User::GV_LASTDNLDLOGMARKER").Value = "                          ") Then
             Dts.Variables("User::MF_UPD_ST").Value = "C"
             Dts.Variables("User::GV_MSG").Value = "No Rows To Process"
         Else : Dts.Variables("User::GV_MSG").Value = "Process Complete"
         End If

         Dts.TaskResult = ScriptResults.Success

     End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.