DtsProperty.GetValue(Object) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
부동산 가치를 반환합니다.
public:
System::Object ^ GetValue(System::Object ^ o);
public object GetValue(object o);
member this.GetValue : obj -> obj
Public Function GetValue (o As Object) As Object
매개 변수
- o
- Object
반환할 값을 반환할 속성의 부모 객체입니다.
반품
속성의 값을 포함하는 객체입니다.
예제
using System;
using Microsoft.SqlServer.Dts.Runtime;
namespace DtsPropertyGetValueCS
{
class Program
{
static void Main(string[] args)
{
Package testPackage;
ConnectionManager testConnection;
DtsProperty testProperty;
string propertyValue;
testPackage = new Package();
testConnection = testPackage.Connections.Add("OLEDB");
testConnection.ConnectionString = "Provider=SQLOLEDB;" +
"Data Source=(local);Initial Catalog=AdventureWorks;" +
"Integrated Security=SSPI";
testConnection.Name = "Test Connection Manager";
testProperty = testConnection.Properties["ServerName"];
propertyValue = testProperty.GetValue(testConnection).ToString();
Console.WriteLine("The value of ServerName is: " + propertyValue);
Console.Read();
}
}
}
Imports Microsoft.SqlServer.Dts.Runtime
Module Module1
Sub Main()
Dim testPackage As Package
Dim testConnection As ConnectionManager
Dim testProperty As DtsProperty
Dim propertyValue As String
testPackage = New Package()
testConnection = testPackage.Connections.Add("OLEDB")
testConnection.ConnectionString = "Provider=SQLOLEDB;" & _
"Data Source=(local);Initial Catalog=AdventureWorks;" & _
"Integrated Security=SSPI"
testConnection.Name = "Test Connection Manager"
testProperty = testConnection.Properties("ServerName")
propertyValue = testProperty.GetValue(testConnection).ToString()
Console.WriteLine("The value of ServerName is: " & propertyValue)
Console.Read()
End Sub
End Module
설명
메서드를 GetValue 호출해 속성의 값을 요청하면, 매개변수로 전달해야 하는 객체가 그 속성이 속한 객체입니다. 예를 들어, 다음 예시에서 볼 수 있는 OLE DB 연결 관리자를 다루고 있고, 그 ServerName 속성에 맞는 객체를 만들 DtsProperty 었다면, 연결 관리자 객체를 메서드의 매개변수로 전달해야 합니다GetValue.