SharepointListAdapterObject interface

Office 2013 and later

Represents a connection to a SharePoint list or document library.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

public interface SharepointListAdapterObject : SharepointListAdapter

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, seeSharepointListAdapter.

Using the members of the SharepointListAdapter interface provides compatibility with InfoPath 2003. To use new members that were added to the SharepointListAdapter2 object model in Microsoft InfoPath 2010, you must cast the object returned by the object to the SharepointListAdapter2 type. For more information, see How to: Use Microsoft.Office.Interop.InfoPath.SemiTrust Members That Are Not Compatible with InfoPath 2003.

The SharePointListAdapter object represents the InfoPath data adapter for retrieving data from a SharePoint list or document library.

For a secondary data source, the SharePointListAdapter object is accessible through the QueryAdapter property of DataSourceObject object. Data adapter objects are accessible through the DataAdapters property of the XDocument object.

SharepointListAdapter SPList = ((SharepointListAdapter)thisXDocument.DataAdapters[“SharePoint list”]);

In the following example, a reference to the SharePointListAdapter 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:

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

After the reference has been set, you can use the methods of the SharePointListAdapter object as shown in the following example, which re-queries the SharePoint list or library to update the DOM property of the data adapter object: