Application.LoadPackage メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
荷物を積み込む。
オーバーロード
| 名前 | 説明 |
|---|---|
| LoadPackage(String, IDTSEvents) |
ファイルシステムから Package を読み込みます。 |
| LoadPackage(String, IDTSEvents, Boolean) |
ファイルシステムから Package を読み込み、スレッディングモデルを指定します。 |
LoadPackage(String, IDTSEvents)
ファイルシステムから Package を読み込みます。
public:
Microsoft::SqlServer::Dts::Runtime::Package ^ LoadPackage(System::String ^ fileName, Microsoft::SqlServer::Dts::Runtime::IDTSEvents ^ events);
public Microsoft.SqlServer.Dts.Runtime.Package LoadPackage(string fileName, Microsoft.SqlServer.Dts.Runtime.IDTSEvents events);
member this.LoadPackage : string * Microsoft.SqlServer.Dts.Runtime.IDTSEvents -> Microsoft.SqlServer.Dts.Runtime.Package
Public Function LoadPackage (fileName As String, events As IDTSEvents) As Package
パラメーター
- fileName
- String
読み込むパッケージを含むファイル名。
- events
- IDTSEvents
IDTSEvents インターフェイスです。
返品
積み込まれた荷物。
例
以下のコード例は、ファイルシステムからパッケージを読み込み、そのパッケージのいくつかのプロパティを返します。
class ApplicationTests
{
static void Main(string[] args)
{
// The variable pkg points to the location of the
// ExecuteProcess package sample installed with
// the SSIS samples.
string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\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);
}
}
Class ApplicationTests
Shared Sub Main(ByVal args() As String)
' The variable pkg points to the location of the
' ExecuteProcess package sample installed with
' the SSIS samples.
Dim pkg As String = "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"
Dim app As Application = New Application()
Dim p As Package = app.LoadPackage(pkg,Nothing)
' Now that the package is loaded, we can query on
' its properties.
Dim n As Integer = p.Configurations.Count
Dim p2 As DtsProperty = p.Properties("VersionGUID")
Dim pl As DTSProtectionLevel = p.ProtectionLevel
Console.WriteLine("Number of configurations = " + n)
Console.WriteLine("VersionGUID = " + p2)
Console.WriteLine("ProtectionLevel = " + pl)
End Sub
End Class
出力例:
Number of configurations = 0
VersionGUID = Microsoft.SqlServer.Dts.Runtime.DtsProperty
ProtectionLevel = EncryptSensitiveWithUserKey
適用対象
LoadPackage(String, IDTSEvents, Boolean)
ファイルシステムから Package を読み込み、スレッディングモデルを指定します。
public:
Microsoft::SqlServer::Dts::Runtime::Package ^ LoadPackage(System::String ^ fileName, Microsoft::SqlServer::Dts::Runtime::IDTSEvents ^ events, bool loadNeutral);
public Microsoft.SqlServer.Dts.Runtime.Package LoadPackage(string fileName, Microsoft.SqlServer.Dts.Runtime.IDTSEvents events, bool loadNeutral);
member this.LoadPackage : string * Microsoft.SqlServer.Dts.Runtime.IDTSEvents * bool -> Microsoft.SqlServer.Dts.Runtime.Package
Public Function LoadPackage (fileName As String, events As IDTSEvents, loadNeutral As Boolean) As Package
パラメーター
- fileName
- String
読み込むパッケージを含むファイル名。
- events
- IDTSEvents
IDTSEvents インターフェイスです。
- loadNeutral
- Boolean
パッケージをニュートラルスレッドとしてロードするかどうかを示すブール値です。 もし違う場合は、アパートのスレッドとして荷物を読み込みます。
返品
積み込まれた荷物。
例
以下のコード例では、ファイルシステムからパッケージを読み込み、 loadNeutral フラグを falseに設定し、その後パッケージのいくつかのプロパティを返します。
class ApplicationTests
{
static void Main(string[] args)
{
// The variable pkg points to the location of the
// ExecuteProcess package sample installed with
// the SSIS samples.
string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";
Application app = new Application();
Package p = app.LoadPackage(pkg, null, false);
// 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);
}
}
Class ApplicationTests
Shared Sub Main(ByVal args() As String)
' The variable pkg points to the location of the
' ExecuteProcess package sample installed with
' the SSIS samples.
Dim pkg As String = "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx"
Dim app As Application = New Application()
Dim p As Package = app.LoadPackage(pkg,Nothing,False)
' Now that the package is loaded, we can query on
' its properties.
Dim n As Integer = p.Configurations.Count
Dim p2 As DtsProperty = p.Properties("VersionGUID")
Dim pl As DTSProtectionLevel = p.ProtectionLevel
Console.WriteLine("Number of configurations = " + n)
Console.WriteLine("VersionGUID = " + p2)
Console.WriteLine("ProtectionLevel = " + pl)
End Sub
End Class
出力例:
Number of configurations = 0
VersionGUID = Microsoft.SqlServer.Dts.Runtime.DtsProperty
ProtectionLevel = EncryptSensitiveWithUserKey