Configuration.CreationName 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
런타임 엔진이 객체의 인스턴스 Configuration 를 생성하고 컬렉션에 Configurations 추가하는 데 사용하는 문자열을 반환합니다. 이 속성은 읽기 전용입니다.
public:
property System::String ^ CreationName { System::String ^ get(); };
public string CreationName { get; }
member this.CreationName : string
Public ReadOnly Property CreationName As String
속성 값
구성 이름이나 ID를 포함하는 문자열입니다.
구현
예제
다음 코드 예시는 패키지를 생성하고, 구성을 활성화하며, 구성 파일의 내보내기를 가능하게 합니다. 패키지 컬렉션에 Configurations 새로운 Configuration 항목을 추가하고, 구성에 여러 속성을 설정합니다. 패키지를 저장하고 다시 불러오면 구성 속성이 표시됩니다. 많은 객체에 대해 가 없다 CreationName는 점에 주목하라. 필수 조건은 아닙니다.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.BulkInsertTask;
namespace configuration_API
{
class Program
{
static void Main(string[] args)
{
// Create a package and set two properties.
Package pkg = new Package();
pkg.EnableConfigurations = true;
pkg.ExportConfigurationFile(@"C:\conf.xml");
// Create a variable object and add it to the
// package Variables collection.
Variable varPkg = pkg.Variables.Add("var", false, "", 100);
varPkg.Value = 1;
string packagePathToVariable = varPkg.GetPackagePath();
// Create a configuration object and add it to the
// package configuration collection.
Configuration config = pkg.Configurations.Add();
// Set properties on the configuration object.
config.ConfigurationString = "conf.xml";
config.Description = "My configuration description";
config.ConfigurationType = DTSConfigurationType.ConfigFile;
config.PackagePath = packagePathToVariable;
// Save the package and its configuration.
Application app = new Application();
app.SaveToXml(@"c:\pkg.xml", pkg, null);
// Reload the package.
Package p1 = app.LoadPackage(@"c:\pkg.xml", null);
// Review the configuration information.
Configurations configs_After = pkg.Configurations;
foreach(Configuration confAfter in configs_After)
{
Console.WriteLine("ConfigurationString is {0}", confAfter.ConfigurationString);
Console.WriteLine("ConfigurationType is {0}", confAfter.ConfigurationType);
Console.WriteLine("CreationName is {0}", confAfter.CreationName);
Console.WriteLine("Description is {0}", confAfter.Description);
Console.WriteLine("Assigned ID is {0}", confAfter.ID);
Console.WriteLine("Name is {0}", confAfter.Name);
}
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.BulkInsertTask
Namespace configuration_API
Class Program
Shared Sub Main(ByVal args() As String)
' Create a package and set two properties.
Dim pkg As Package = New Package()
pkg.EnableConfigurations = True
pkg.ExportConfigurationFile("C:\conf.xml")
' Create a variable object and add it to the
' package Variables collection.
Dim varPkg As Variable = pkg.Variables.Add("var",False,"",100)
varPkg.Value = 1
Dim packagePathToVariable As String = varPkg.GetPackagePath()
' Create a configuration object and add it to the
' package configuration collection.
Dim config As Configuration = pkg.Configurations.Add()
' Set properties on the configuration object.
config.ConfigurationString = "conf.xml"
config.Description = "My configuration description"
config.ConfigurationType = DTSConfigurationType.ConfigFile
config.PackagePath = packagePathToVariable
' Save the package and its configuration.
Dim app As Application = New Application()
app.SaveToXml("c:\pkg.xml", pkg, Nothing)
' Reload the package.
Dim p1 As Package = app.LoadPackage("c:\pkg.xml",Nothing)
' Review the configuration information.
Dim configs_After As Configurations = pkg.Configurations
Dim confAfter As Configuration
For Each confAfter In configs_After
Console.WriteLine("ConfigurationString is {0}", confAfter.ConfigurationString)
Console.WriteLine("ConfigurationType is {0}", confAfter.ConfigurationType)
Console.WriteLine("CreationName is {0}", confAfter.CreationName)
Console.WriteLine("Description is {0}", confAfter.Description)
Console.WriteLine("Assigned ID is {0}", confAfter.ID)
Console.WriteLine("Name is {0}", confAfter.Name)
Next
End Sub
End Class
End Namespace
샘플 출력:
변수 var의 값 = 1
ConfigurationString은 conf.xml
ConfigurationType은 ConfigFile
크리에이션네임은
설명은 제 구성 설명입니다
할당된 ID는 {9CF65E37-0833-44CD-A99D-EBFE38FAB31B}입니다.
이름은 {9CF65E37-0833-44CD-A99D-EBFE38FAB31B}입니다.
패키지 경로는 \Package.Variables[::var]
설명
이름은 관리 어셈블리의 경우 완전 자격 어셈블리 이름일 수도 있고, PROGID 또는 COM DLL DLL의 경우 CLSID일 수도 있습니다.