次の方法で共有


DtsProperty.GetValue Method

プロパティの値を返します。

名前空間: Microsoft.SqlServer.Dts.Runtime
アセンブリ: Microsoft.SqlServer.ManagedDTS (microsoft.sqlserver.manageddts.dll 内)

構文

'宣言
Public Function GetValue ( _
    o As Object _
) As Object
public Object GetValue (
    Object o
)
public:
Object^ GetValue (
    Object^ o
)
public Object GetValue (
    Object o
)
public function GetValue (
    o : Object
) : Object

パラメータ

  • o
    値が返されるプロパティの親オブジェクトです。

戻り値

プロパティの値を含むオブジェクトです。

解説

更新されたテキスト :2006 年 7 月 17 日

GetValue メソッドを呼び出してプロパティの値を要求する場合は、そのプロパティが属しているオブジェクトをパラメータとして渡す必要があります。たとえば、次の例のように OLE DB 接続マネージャを操作し、その ServerName プロパティに対して DtsProperty オブジェクトを作成した場合は、この接続マネージャ オブジェクトをパラメータとして GetValue メソッドに渡します。

使用例

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

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

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

変更履歴

リリース

履歴

2006 年 7 月 17 日

変更内容 :
  • メソッドのパラメータの使用方法について説明しました。