This documentation is preliminary and is subject to change.
Represents a data connection for retrieving data from a SharePoint list or document library.
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, seeSharePointListAdapterRW
Code written with the members implemented by the class is not compatible with a data connection to a SharePoint list or document library created in InfoPath 2003 or InfoPath 2007, with a data connection in a new form template created in InfoPath with one of the InfoPath 2007 Form Templates, or with a data connection converted with the Convert to Previous Version button in the Data Connections dialog box. If you do not need to maintain compatibility with an earlier version of InfoPath and want to write code with members implemented by the class, you can convert the data connection with the Convert to Current Version button in the Data Connections dialog box.
The SharePointListAdapterRW object represents a Microsoft InfoPath data connection for retrieving from a SharePoint list or document library.
For a secondary data source, the SharePointListAdapterRW object is accessible through the QueryAdapter property of DataSourceObject object. Data adapter objects are accessible through the DataAdapters property of the XDocument object.
SharePointListAdapterRWObject SPList = ((SharePointListAdapterRWObject)thisXDocument.DataAdapters["SharePoint list"]); thisXDocument.UI.Alert(SPList.SiteUrl); SPList.Query();
In the following example, a reference to the SharePointListAdapterRW object is accessed through the QueryAdapter property of a data adapter object by passing the name of the data adapter object to the Item property of the DataAdaptersCollection collection:
SharePointListAdapterRW adapter; adapter = (SharePointListAdapterRW) thisXDocument.DataAdapters["Announcements"];
After the reference has been set, you can use the methods of the SharePointListAdapterRW object as shown in the following example, which calls the Query() method to re-query the SharePoint list or library to update the DOM property of the data adapter object: