Script Task Issue

  • Im having trouble getting Console.Writeline() to work in Script Task [VB.Net].Visual Studio 2008

    There is no pop up of Console window showing up.

    Here is just a simple code Im trying with, and I have added the "C:\WINDOWS\Microsoft.NET\Framework\v3.5" to Path variable in Environment Var and ensured vbc.exe exist in this folder.

    Public Sub Main()

    Dim str As String

    str = "Testing Testing"

    Console.WriteLine(str)

    Console.ReadLine()

    'Added msg box just for testing, and this works fine !

    MessageBox.Show(str)

    End Sub

    I need to get this working so I can test the real code that Im working on......:pinch:

  • I could be wrong, but I don't think SSIS supports that. It's not designed to work with a consol, it's really supposed to run without any sort of front end, on an unattended server.

    Might work to write the values you want to a log table or log file, since it is designed to do those things.

    I'm far from an expert on scripting, so don't take this as any sort of expert statement. (My specialties are designing and coding in the database, not scripting in SSIS.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Why not just set a breakpoint or two and then run the package? You'll get into a full, interactive debugging session, much richer than writing out the odd result to the console.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Will do that.Thanks

  • LOOKUP_BI-756009 (1/11/2010)


    Im having trouble getting Console.Writeline() to work in Script Task [VB.Net].Visual Studio 2008

    There is no pop up of Console window showing up.

    Here is just a simple code Im trying with, and I have added the "C:\WINDOWS\Microsoft.NET\Framework\v3.5" to Path variable in Environment Var and ensured vbc.exe exist in this folder.

    Public Sub Main()

    Dim str As String

    str = "Testing Testing"

    Console.WriteLine(str)

    Console.ReadLine()

    'Added msg box just for testing, and this works fine !

    MessageBox.Show(str)

    End Sub

    I need to get this working so I can test the real code that Im working on......:pinch:

    This is not the correct approach. If you want to trace and debug your package, you can use the standard SSIS facilities and objects for logging and events. For example to generate an event with test information use the following code:

    Dim fa As Boolean

    Call Dts.Events.FireInformation(0, "My Script", "Your Test Message", String.Empty, 0, fa)

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

Viewing 5 posts - 1 through 4 (of 4 total)

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