using System;
using Microsoft.SqlServer.Dts.Runtime;
namespace Microsoft.SqlServer.Dts.Samples
{
   class CreatingAPackage
   {
      Package package;
      public CreatingAPackage()
      {
         package   = new Package();
      }
   }
}
using System;
using Microsoft.SqlServer.Dts.Runtime;
namespace Microsoft.SqlServer.Dts.Samples
{
class ApplicationTests
    {
        static void Main(string[] args)
        {
            // The variable pkg points to the location of the
            // ExecuteProcess package sample that was installed with
            // the SSIS samples.
            string pkg = @"C:\Program Files\Microsoft SQL Server\90\Tools\Samples\1033\DataTransformationServices\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";

            Application app = new Application();
            Package p = app.LoadPackage(pkg, null);
           // Now that the package is loaded, we can query on
           // its properties.
            int n = p.Configurations.Count;
            DtsProperty  p2 = p.Properties["VersionGUID"];
            DTSProtectionLevel pl = p.ProtectionLevel;

            Console.WriteLine("Number of configurations = " + n);
            Console.WriteLine("VersionGUID = " + p2);
            Console.WriteLine("ProtectionLevel = " + pl);
        }
    }
}












----Microlong
Very easy
Posted on 2005-08-24 15:13  微龙™  阅读(645)  评论(0)    收藏  举报