Script Task Cannot execute script because the script entry point is invalid
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
May 21st, 2012 3:07pm
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
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2012 3:14pm
But still I am getting the same error..could you please helme on it little brief...Thanks
May 21st, 2012 3:26pm
Hi,
The following link might be helpful.
http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/dc15ea13-4b5d-45bd-b6b9-965de144a24cESHANI. Please click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2012 8:04pm
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 createsChuck
May 21st, 2012 10:28pm
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
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2012 11:57pm
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
May 22nd, 2012 12:00am