locked
Script Task Cannot execute script because the script entry point is invalid RRS feed

  • Question

  • Hi Guys

    I am getting the below error while running the SSIS script task. Please help on it. Thanks

    "Cannot execute script because the script entry point is invalid"

    Code

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Runtime
    Imports System.IO
    Imports System.Net
    <System.AddIn.AddIn("ScriptMain", Version:="1.0", Publisher:="", Description:="")> _
    <System.CLSCompliantAttribute(False)> _
    Partial Public Class ScriptMain
        Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
        Enum ScriptResults
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        End Enum
    End Class
    ' To open Help, press F1.
    Module Module1
        Public Sub Main()
            '
            ' Add your code here
            '
            'Address of URL
            Dim URL As String = "http://sername/folder/showDashBoard#"
            ' Get HTML data
            Dim client As WebClient = New WebClient()
            Dim data As Stream = client.OpenRead(URL)
            Dim reader As StreamReader = New StreamReader(data)
            Dim str As String = ""
            str = reader.ReadLine()
            Do While str.Length > 0
                Console.WriteLine(str)
                str = reader.ReadLine()
            Loop
        End Sub
    End Module

    Monday, May 21, 2012 7:04 PM

Answers

  • in script task you will find propery like entry point inwhich write main as an entry point.

    Regards, nishantcomp2512 Please mark posts as answered where appropriate

    • Proposed as answer by Eileen Zhao Thursday, May 24, 2012 8:43 AM
    • Marked as answer by Eileen Zhao Monday, May 28, 2012 2:30 AM
    Tuesday, May 22, 2012 3:57 AM

All replies

  • Edit - Your class has no main.  Get rid of the Module stuff and put the main in Class ScriptMain like below.  And your main was not returning a result

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Runtime
    Imports System.IO
    Imports System.Net
    <System.AddIn.AddIn("ScriptMain", Version:="1.0", Publisher:="", Description:="")> _
    <System.CLSCompliantAttribute(False)> _
    Partial Public Class ScriptMain
        Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
        Enum ScriptResults
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        End Enum
    
    ' To open Help, press F1.
    
        Public Sub Main()
            '
            ' Add your code here
            '
            'Address of URL
            Dim URL As String = "http://sername/folder/showDashBoard#"
            ' Get HTML data
            Dim client As WebClient = New WebClient()
            Dim data As Stream = client.OpenRead(URL)
            Dim reader As StreamReader = New StreamReader(data)
            Dim str As String = ""
            str = reader.ReadLine()
            Do While str.Length > 0
                Console.WriteLine(str)
                str = reader.ReadLine()
            Loop
     Dts.TaskResult = ScriptResults.Success
        End Sub
    End Class


    Do this


    Monday, May 21, 2012 7:11 PM
  • But still I am getting the same error..could you please helme on it little brief...Thanks
    Monday, May 21, 2012 7:23 PM
  • Hi,

    The following link might be helpful.

    http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/dc15ea13-4b5d-45bd-b6b9-965de144a24c


    ESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

    Tuesday, May 22, 2012 12:01 AM
  • But still I am getting the same error..could you please helme on it little brief...Thanks

    Just delete the script task and create a new one.  Then paste in the guts of your main proc to the new one it creates

    Chuck

    Tuesday, May 22, 2012 2:25 AM
  • in script task you will find propery like entry point inwhich write main as an entry point.

    Regards, nishantcomp2512 Please mark posts as answered where appropriate

    • Proposed as answer by Eileen Zhao Thursday, May 24, 2012 8:43 AM
    • Marked as answer by Eileen Zhao Monday, May 28, 2012 2:30 AM
    Tuesday, May 22, 2012 3:57 AM