Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009

    Unanswered: C# DTS Package Execute

    Hi All,

    I am creating a simple C# 2008 Application which will run a DTS Package on a SQL Server 2000. The Package takes data on an external computer, and places it into a Database Table. After some fighting with code, as seen below, I got the majority to work. I am able to view all the Package info (such as name, date created, etc), however when the code reaches the Package.Execute() command, nothing happens. I know the package works manually when i run it in SQL Server 2000, and it appears to only not work in C#.

                    Package2Class package = new Package2Class();
                    object pVarPersistStgOfHost = null;
                    // Create Package Reference TO SQL Server
                        ref pVarPersistStgOfHost);
                    // Execute Package
                    package.Execute();        // THIS DOES NOT WORK :(
                    // Force Release() On COM Object
                    package = null;
                catch (System****ntime.InteropServices.COMException e)
                    txtStatus.Text += "\r\n" + e.Message;
                catch (System.Exception e)
                    txtStatus.Text += "\r\n" + e.Message;
    There are three systems involved here.
    My computer used for coding.
    The server hosting the database.
    The computer with the source text file for the package.

    Any help is much appreciated.
    Thank you.

  2. #2
    Join Date
    Nov 2004
    on the wrong server
    Provided Answers: 6
    permissions issue. you app is connecting with different credentials than your personal credentials.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Dec 2009
    Thanks for the quick reply!

    Is there any easy way to remedy this, or would it just be easier to move the app to the computer with the source .txt file?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts