Поделиться через


Свойство ConnectionInfo.ID

Represents the GUID assigned to the connection. This value is read-only.

Пространство имен:  Microsoft.SqlServer.Dts.Runtime
Сборка:  Microsoft.SqlServer.ManagedDTS (в Microsoft.SqlServer.ManagedDTS.dll)

Синтаксис

'Декларация
Public ReadOnly Property ID As String 
    Get
'Применение
Dim instance As ConnectionInfo 
Dim value As String 

value = instance.ID
public string ID { get; }
public:
virtual property String^ ID {
    String^ get () sealed;
}
abstract ID : string 
override ID : string
final function get ID () : String

Значение свойства

Тип: System.String
The GUID assigned to the connection.

Реализует

IDTSName.ID

Замечания

This property is visible as the ID property, which is commonly shown in the Properties dialog box for a connection.

Примеры

The following code example creates an Application object, iterates through the default connections on the computer and then lists the properties of each connection. In this example, the ID is shown as "{41F5EFE4-E91A-4EB0-BF10-D40FD48B3C03}".

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

namespace ConnInfoTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Application dtsApplication = new Application();
            ConnectionInfos connectionInfos = dtsApplication.ConnectionInfos;

            foreach (ConnectionInfo connInfo in connectionInfos)
            {
                Console.WriteLine(connInfo.ConnectionContact);
                Console.WriteLine(connInfo.ConnectionType);
                Console.WriteLine(connInfo.CreationName);
                Console.WriteLine(connInfo.Description);
                Console.WriteLine(connInfo.FileName);
                //Console.WriteLine(connInfo.FileNameVersionString);
                Console.WriteLine(connInfo.IconFile);
                Console.WriteLine(connInfo.IconResource);
                Console.WriteLine(connInfo.ID);
                Console.WriteLine(connInfo.Name);
                Console.WriteLine(connInfo.UITypeName);
            }
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace ConnInfoTest
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim dtsApplication As Application =  New Application() 
            Dim connectionInfos As ConnectionInfos =  dtsApplication.ConnectionInfos 
 
            Dim connInfo As ConnectionInfo
            For Each connInfo In connectionInfos
                Console.WriteLine(connInfo.ConnectionContact)
                Console.WriteLine(connInfo.ConnectionType)
                Console.WriteLine(connInfo.CreationName)
                Console.WriteLine(connInfo.Description)
                Console.WriteLine(connInfo.FileName)
                'Console.WriteLine(connInfo.FileNameVersionString)
                Console.WriteLine(connInfo.IconFile)
                Console.WriteLine(connInfo.IconResource)
                Console.WriteLine(connInfo.ID)
                Console.WriteLine(connInfo.Name)
                Console.WriteLine(connInfo.UITypeName)
            Next
        End Sub
    End Class
End Namespace

Sample Output:

Microsoft Corporation

FILE

DTS.ConnectionManagerFile.1

Connection Manager for Files

C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DtsConn.dll

C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DtsConn.dll

0

{41F5EFE4-E91A-4EB0-BF10-D40FD48B3C03}

DTS Connection Manager for Files

Microsoft.DataTransformationServices.Design.SingleFileConnectionManagerUI,

Microsoft.DataTransformationServices.Design, Version=10.0.000.0,

Culture=neutral, PublicKeyToken=89845dcd8080cc91

См. также

Справочник

ConnectionInfo Класс

Пространство имен Microsoft.SqlServer.Dts.Runtime