언어

Sequence.GetExpression(String) 메서드

정의

지정된 속성에 대한 표현식을 포함하는 문자열을 반환합니다. null은 표현식이 할당되지 않는다는 뜻입니다.

public:
 virtual System::String ^ GetExpression(System::String ^ propertyName);
public string GetExpression(string propertyName);
abstract member GetExpression : string -> string
override this.GetExpression : string -> string
Public Function GetExpression (propertyName As String) As String

매개 변수

propertyName
String

보고 싶은 표현이 있는 부동산의 이름입니다.

반품

속성을 평가하는 데 사용되는 식을 포함하는 문자열입니다.

구현

예제

다음 코드 예시는 컨테이너에서 SequenceDescription 값을 수정하는 데 사용됩니다SetExpression. 그 다음 GetExpression 를 사용하여 식을 가져옵니다.

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

namespace Microsoft.SqlServer.SSIS.Sample  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            const String containerName = "Sequence";  
            Package pkg = new Package();  
            Sequence sequence = (Sequence)pkg.Executables.Add("STOCK:Sequence");  
            DtsProperties seqProps = sequence.Properties;  

            // View information about the Description property  
            // before setting it using the SetExpression method.  
            String desc = sequence.Description;  
            Console.WriteLine("Original value of Description: {0}", desc);  

            // Use SetExpression to give the Sequence a description.  
            String myExpression = "\"Testing " + containerName + "\"";   
            sequence.SetExpression("Description", myExpression);  
            // Note that I've tried using the Properties bag instead, with no change to the results.  
            //seqProps["Description"].SetExpression(sequence, myExpression);   

            //Validate the package to set the expression onto the property.  
            DTSExecResult valResult = pkg.Validate(null, null, null, null);  

            // Retrieve the new value and the expression.  
            String myNewDesc = sequence.Description;  
            String myNewExpression = sequence.GetExpression("Description");  
            Console.WriteLine("New value of Description: {0}", myNewDesc);  
            Console.WriteLine("Expression for Description: {0}", myNewExpression);  
        }  
    }  
}  

샘플 출력:

설명의 원래 가치:

새로운 설명 값: 테스트 서열

설명 표현: "서열 테스트

설명

객체 위 propertyName 에서 사용할 수 있는 모든 속성이 될 수 있습니다.

적용 대상