Share via


SharePointListAdapterRWObject 接口

代表用于从 SharePoint 列表或文档库检索数据的数据连接。

命名空间:  Microsoft.Office.Interop.InfoPath.SemiTrust
程序集:  Microsoft.Office.Interop.InfoPath.SemiTrust(位于 Microsoft.Office.Interop.InfoPath.SemiTrust.dll 中)

语法

声明
<GuidAttribute("096cd635-0786-11d1-95fa-0080c78ee3bb")> _
Public Interface SharePointListAdapterRWObject _
    Inherits SharePointListAdapterRW
用法
Dim instance As SharePointListAdapterRWObject
[GuidAttribute("096cd635-0786-11d1-95fa-0080c78ee3bb")]
public interface SharePointListAdapterRWObject : SharePointListAdapterRW

备注

此类型是用于 Coclass(托管代码需要此 Coclass 来实现 COM 互操作性)的包装。使用此类型来访问由此 Coclass 实现的 COM 接口。有关 COM 接口的信息(包括指向其成员说明的链接),请参阅SharePointListAdapterRW

备注

利用通过 SharePointListAdapterRWObject 类实现的成员来编写的代码与以下数据连接不兼容:在 InfoPath 2003 或 InfoPath 2007 中创建的 SharePoint 列表或文档库的数据连接,在 InfoPath 中使用"InfoPath 2007 表单模板"之一创建的新表单模板中的数据连接,或者利用"数据连接"对话框中的"转换为以前版本"按钮转换的数据连接。如果无需保持与 InfoPath 早期版本的兼容性,并想利用通过 SharePointListAdapterRWObject 类实现的成员来编写代码,则可以使用"数据连接"对话框中的"转换为当前版本"按钮来转换数据连接。

SharePointListAdapterRW对象代表用于从 SharePoint 列表或文档库检索Microsoft InfoPath数据连接。

对于辅助数据源, SharePointListAdapterRW对象是通过DataSourceObject对象的QueryAdapter属性可访问。数据适配器对象是通过XDocument对象的DataAdapters属性可访问。

示例

SharePointListAdapterRWObject SPList = ((SharePointListAdapterRWObject)thisXDocument.DataAdapters["SharePoint list"]);
thisXDocument.UI.Alert(SPList.SiteUrl);
SPList.Query();

在下列示例中,对 SharePointListAdapterRW 对象的引用可通过数据适配器对象的 QueryAdapter 属性访问,方法是将此数据适配器对象的名称传递给 DataAdaptersCollection 集合的 Item 属性:

SharePointListAdapterRW adapter;
adapter = (SharePointListAdapterRW) thisXDocument.DataAdapters["Announcements"];

设置该引用后,可以按以下示例所示使用 SharePointListAdapterRW 对象的方法,该示例调用 Query() 方法重新查询 SharePoint 列表或库来更新数据适配器对象的 DOM 属性:

adapter.Query();

另请参阅

引用

SharePointListAdapterRWObject 成员

Microsoft.Office.Interop.InfoPath.SemiTrust 命名空间