次の方法で共有


SharepointListQueryConnection クラス

SharePoint リストまたはドキュメント ライブラリからデータを取得するための接続を表します。

名前空間: Microsoft.Office.InfoPath
アセンブリ: Microsoft.Office.InfoPath (microsoft.office.infopath.dll 内)

構文

'宣言
Public MustInherit Class SharepointListQueryConnection
    Inherits DataConnection
'使用
Dim instance As SharepointListQueryConnection
public abstract class SharepointListQueryConnection : DataConnection

コメント

SharePointListQueryConnection オブジェクトは、データ接続ウィザードを使用して InfoPath で作成されたデータ接続を表し、SharePoint リストまたはドキュメント ライブラリからデータを取得するために必要なすべての情報を指定します。

SharePointListQueryConnection クラスが提供するプロパティを使用すると、データ接続の名前や、接続がデータを取得してくる Windows SharePoint Services サイト上のリストまたはドキュメント ライブラリの URL (Uniform Resource Locator) を取得することができます。

データ接続と関連付けられた SharePointListQueryConnection オブジェクトは、XmlForm クラスの DataConnections プロパティを使用してアクセスでき、フォーム テンプレートの DataConnectionCollection から接続を返します。

既定の Execute メソッドは、DataConnection 基本クラスから継承され、InfoPath のフォーム テンプレート デザイン モードで宣言的に定義された値を使用して、クエリや送信処理を実行します。さらに、SharePointListQueryConnection クラスが提供する SharepointListQueryConnection.Execute メソッドを使用すると、返されたデータを挿入する別の場所を指定できます。

SharePointListQueryConnection クラスは、Microsoft Office InfoPath 2003 オブジェクト モデルの SharePointListAdapterObject インターフェイスに対応しています。

次の例では、SharePoint 上の連絡先情報の一覧に接続する "Contacts" という名前の接続を表す SharePointListQueryConnection オブジェクトへの参照を、DataConnectionCollection クラスの Item プロパティに名前を渡した後、返されたオブジェクトを SharePointListQueryConnection 型にキャストすることで設定しています。

[C#]

SharePointListQueryConnection spConnection = (SharePointListQueryConnection)this.DataConnections["Contacts"];
Dim spConnection As SharePointListQueryConnection = _
   DirectCast(Me.DataConnections("Contacts"), _
   SharePointListQueryConnection)

参照が設定された後は、SharePointListQueryConnection オブジェクトのプロパティやメソッドを使用できます。次の例では、DataConnection 基本クラスから継承される Name プロパティによって返される値を、文字列変数に設定しています。

string spName = spConnection.Name;
Dim spName As String = spConnection.Name

継承階層

System.Object
   Microsoft.Office.InfoPath.DataConnection
    Microsoft.Office.InfoPath.SharepointListQueryConnection

スレッド セーフ

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

関連項目

参照

SharepointListQueryConnection のメンバ
Microsoft.Office.InfoPath 名前空間