Share via


InnerObject プロパティ

作成された特定の接続の種類を返します。このプロパティは読み取り専用です。

名前空間:  Microsoft.SqlServer.Dts.Runtime
アセンブリ:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)

構文

'宣言
<BrowsableAttribute(False)> _
Public ReadOnly Property InnerObject As Object
    Get
'使用
Dim instance As ConnectionManager
Dim value As Object

value = instance.InnerObject
[BrowsableAttribute(false)]
public Object InnerObject { get; }
[BrowsableAttribute(false)]
public:
virtual property Object^ InnerObject {
    Object^ get () sealed;
}
[<BrowsableAttribute(false)>]
abstract InnerObject : Object
[<BrowsableAttribute(false)>]
override InnerObject : Object
final function get InnerObject () : Object

プロパティ値

型: System. . :: . .Object
ホストされている項目を表すオブジェクトです。このオブジェクトは、接続の種類と一致するクラスにキャストされます。Microsoft.SqlServer.Dts.ManagedConnections で定義されている接続を除いて、これらの接続オブジェクトはネイティブであり、ネイティブ クラスにキャストされる必要があります。これは、コード例の "System.__ComObject" という値を表示する InnerObject によって示されます。

実装

IDTSObjectHost. . :: . .InnerObject

使用例

次のコード例では、2 つの接続を持つ既存のパッケージを読み込みます。パッケージ内の接続マネージャーを繰り返し処理し、InnerObject など、さまざまなプロパティの値を出力します。

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;

namespace Connections_Collection
{
    class Program
    {
        static void Main(string[] args)
        {
           // The package is one of the SSIS Samples.
            string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
            
            // Create an application and load the sample.
            Application app = new Application();
            Package pkg = app.LoadPackage(mySample, null);
            Connections myConns = pkg.Connections;
            int connCount = myConns.Count;
            Console.WriteLine("The number of connections in the package is: {0}", connCount);
            
            // Enumerate over the collection, printing out
            // the values for various properties.
            foreach (ConnectionManager connMgr in myConns)
            {
                Console.WriteLine("ConnectionString:        {0}", connMgr.ConnectionString);
                Console.WriteLine("CreationName:            {0}", connMgr.CreationName);
                Console.WriteLine("DelayValidation:         {0}", connMgr.DelayValidation);
                Console.WriteLine("Description:             {0}", connMgr.Description);
                Console.WriteLine("HostType:                {0}", connMgr.HostType);
                Console.WriteLine("ID:                      {0}", connMgr.ID);
                Console.WriteLine("InnerObject:             {0}", connMgr.InnerObject);
                Console.WriteLine("Name:                    {0}", connMgr.Name);
                Console.WriteLine("ProtectionLevel:         {0}", connMgr.ProtectionLevel);
                Console.WriteLine("SupportsDTCTransactions: {0}", connMgr.SupportsDTCTransactions);
            }
            Console.WriteLine("");
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace Connections_Collection
    Class Program
        Shared  Sub Main(ByVal args() As String)
           ' The package is one of the SSIS Samples.
            Dim mySample As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx" 
 
            ' Create an application and load the sample.
            Dim app As Application =  New Application() 
            Dim pkg As Package =  app.LoadPackage(mySample,Nothing) 
            Dim myConns As Connections =  pkg.Connections 
            Dim connCount As Integer =  myConns.Count 
            Console.WriteLine("The number of connections in the package is: {0}", connCount)
 
            ' Enumerate over the collection, printing out
            ' the values for various properties.
            Dim connMgr As ConnectionManager
            For Each connMgr In myConns
                Console.WriteLine("ConnectionString:        {0}", connMgr.ConnectionString)
                Console.WriteLine("CreationName:            {0}", connMgr.CreationName)
                Console.WriteLine("DelayValidation:         {0}", connMgr.DelayValidation)
                Console.WriteLine("Description:             {0}", connMgr.Description)
                Console.WriteLine("HostType:                {0}", connMgr.HostType)
                Console.WriteLine("ID:                      {0}", connMgr.ID)
                Console.WriteLine("InnerObject:             {0}", connMgr.InnerObject)
                Console.WriteLine("Name:                    {0}", connMgr.Name)
                Console.WriteLine("ProtectionLevel:         {0}", connMgr.ProtectionLevel)
                Console.WriteLine("SupportsDTCTransactions: {0}", connMgr.SupportsDTCTransactions)
            Next
 
            Console.WriteLine("")
        End Sub
    End Class
End Namespace

サンプルの出力 :

The number of connections in the package is: 2

ConnectionString: Data Source=localhost;Initial Catalog=AdventureWorks2008R2;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Auto Translate=False;

CreationName: OLEDB

DelayValidation: False

Description:

HostType: ConnectionManager

ID: {3427BFE1-F10C-4B7E-8E70-E8D9DC7DDBA3}

InnerObject: System.__ComObject

Name: localhost.AdventureWorks2008R2

ProtectionLevel: EncryptSensitiveWithUserKey

SupportsDTCTransactions: true

ConnectionString: C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\results.txt

CreationName: FLATFILE

DelayValidation: False

Description:

HostType: ConnectionManager

ID: {48B66F8D-7DFE-4D85-91C7-0999655484B2}

InnerObject: System.__ComObject

Name: Transaction Summary by Product1

ProtectionLevel: EncryptSensitiveWithUserKey

SupportsDTCTransactions: False