Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    41

    Unanswered: Passing parameters to DTS in C#

    I have a dts package file. I am able to execute the file thro C#. I want to pass userid, password, datasource through program. How to do this?

    DTS.PackClass package = new DTS.PackClass();

    string filename = @"c:\abc.dts";
    string password = null;
    string packageID = null;
    string versionID = null;
    string name = "DTSPack";
    object pVarPersistStfOfHost = null;

    package.LoadFromStorageFile(filename, password, packageID,
    versionID, name, ref pVarPersistStfOfHost);
    package.Execute();
    package.UnInitialize();
    package = null;


    Thanks
    Jtamil

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    May check the site http://www.sqldts.com for further information.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  3. #3
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    call the dtsrun utillity from the shell.
    dtsrun will accept username password packagename and any other global variables you can create in the package
    so you dont have to reinvent the wheel.

    [Books Online] dtsrun Utility




    RDJabarov this is for you
    "Scott does DTS"

Posting Permissions

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