Package.VersionBuild Property

Gets or sets the build version of the package.

命名空間: Microsoft.SqlServer.Dts.Runtime
組件: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

語法

'宣告
Public Property VersionBuild As Integer
public int VersionBuild { get; set; }
public:
property int VersionBuild {
    int get ();
    void set (int value);
}
/** @property */
public int get_VersionBuild ()

/** @property */
public void set_VersionBuild (int value)
public function get VersionBuild () : int

public function set VersionBuild (value : int)

屬性值

An Integer that contains the build version of the package.

範例

The following example retrieves version information from a package installed with the SSIS samples.

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

namespace Package_API
{
    class Program
    {
        static void Main(string[] args)
        {
            Application app = new Application();
            Package pkg = new Package();
            pkg = app.LoadPackage(@"C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx", null);

            // Review several properties on the sample package using different techniques.
            int pkgBuild = pkg.VersionBuild;
            int pkgVerMajor = pkg.VersionMajor;
            int pkgVerMinor = pkg.VersionMinor;
            String entireVersion = pkgVerMajor.ToString() + "." + pkgVerMinor.ToString();

            Console.WriteLine("Build number for package {0}", pkgBuild);
            Console.WriteLine("any comments? {0}", pkg.VersionComments);
            Console.WriteLine("What is the GUID? {0}", pkg.VersionGUID);
            Console.WriteLine("Version numbers {0}", entireVersion);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace Package_API
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim app As Application =  New Application() 
            Dim pkg As Package =  New Package() 
            pkg = app.LoadPackage("C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx", Nothing)
 
            ' Review several properties on the sample package using different techniques.
            Dim pkgBuild As Integer =  pkg.VersionBuild 
            Dim pkgVerMajor As Integer =  pkg.VersionMajor 
            Dim pkgVerMinor As Integer =  pkg.VersionMinor 
            Dim entireVersion As String =  pkgVerMajor.ToString() + "." + pkgVerMinor.ToString() 
 
            Console.WriteLine("Build number for package {0}", pkgBuild)
            Console.WriteLine("any comments? {0}", pkg.VersionComments)
            Console.WriteLine("What is the GUID? {0}", pkg.VersionGUID)
            Console.WriteLine("Version numbers {0}", entireVersion)
        End Sub
    End Class
End Namespace

Sample Output:

Build number for package 143

any comments?

What is the GUID? {0FF64FA0-2FB7-49C1-BB20-6439EDD1EE44}

Version numbers 1.0

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

Package Class
Package Members
Microsoft.SqlServer.Dts.Runtime Namespace