Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Dim app As Application = New Application()
        Dim package As Package = Nothing
        Dim IsSucceed As Boolean = False
        '//Load the SSIS Package which will be executed
        package = app.LoadPackage("D:\UploadFinacle\New_Updt_Cust_Accnt_Upload.dtsx", Nothing)
        '//P/ass the varibles into SSIS Package
        package.Variables("User::BrCode").Value = branchcode
        package.PackagePassword = "1234"
        '//Execute the SSIS Package and store the Execution Result
        Dim results As Microsoft.SqlServer.Dts.Runtime.DTSExecResult = package.Execute()
        '//Check the results for Failure and Success
        If results = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure Then
            Dim err As String = ""
            Dim local_DtsError As Microsoft.SqlServer.Dts.Runtime.DtsError
            For Each local_DtsError In package.Errors
                Dim aa As String = local_DtsError.Description.ToString()
                err = err + aa
            Next
        End If



I M USING This CODE TO UPLOAD RECORD FROM SQL TABLE TO ORACLE

BUT When I Call Package through this code , it take some time to execute completely because of this it always return false but process is still working ,so i want to check whether package executed or not
Posted
Comments
Sergey Alexandrovich Kryukov 4-Jan-14 1:42am    
There are no cases when using hard-coded file path name can be useful, except, maybe, just experimenting...
—SA
Sergey Alexandrovich Kryukov 4-Jan-14 1:44am    
And who told you that a process is still working? By documentation, this is not an asynchronous method:
http://technet.microsoft.com/en-us/library/ms190901.aspx.
Besides, it cannot return false in principle, because return type is not Boolean; this is DTSExecResult.
—SA
Dave Kreskowiak 4-Jan-14 10:43am    
I wish I could hit you with a 5 on this one.
Sergey Alexandrovich Kryukov 4-Jan-14 13:18pm    
Thank you, Dave. I did not put it as an answer only because I never tried anything like that...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900