IDTSObjectHost.HostType Propriedade

Definição

Retorna um valor da enumeração DTSObjectHostType que indica o tipo deste host.

public:
 property Microsoft::SqlServer::Dts::Runtime::DTSObjectHostType HostType { Microsoft::SqlServer::Dts::Runtime::DTSObjectHostType get(); };
public Microsoft.SqlServer.Dts.Runtime.DTSObjectHostType HostType { get; }
member this.HostType : Microsoft.SqlServer.Dts.Runtime.DTSObjectHostType
Public ReadOnly Property HostType As DTSObjectHostType

Valor da propriedade

DTSObjectHostType

Um valor da enumeração DTSObjectHostType.

Exemplos

O exemplo de código a seguir mostra o uso do InnerObject pela ConnectionManager classe. O exemplo de código carrega um pacote existente que tem duas conexões. Ele itera através dos gerenciadores de conexões no pacote e imprime os valores de várias propriedades, incluindo o HostType .

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  

Saída de exemplo:

O número de conexões no pacote é: 2

ConnectionString: fonte de dados = localhost; catálogo inicial = AdventureWorks; Provedor = SQLOLEDB. 1; segurança integrada = SSPI; Informações de persistência de segurança = falso; Conversão automática = falso;

CreationName: OLEDB

DelayValidation: false

Descrição:

HostType: ConnectionManager

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

InnerException: System. __ComObject

Nome: localhost. AdventureWorks

ProtectionLevel: EncryptSensitiveWithUserKey

SupportsDTCTransactions: true

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

CreationType: FLATfile

DelayValidation: false

Descrição:

HostType: ConnectionManager

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

InnerException: System. __ComObject

Name: Resumo de transação por Product1

ProtectionLevel: EncryptSensitiveWithUserKey

SupportsDTCTransactions: false

Aplica-se a