SharepointListAdapterObject Interface

Definition

Represents a connection to a SharePoint list or document library.

public interface class SharepointListAdapterObject : Microsoft::Office::Interop::InfoPath::SemiTrust::SharepointListAdapter
[System.Runtime.InteropServices.Guid("096cd69a-0786-11d1-95fa-0080c78ee3bb")]
public interface SharepointListAdapterObject : Microsoft.Office.Interop.InfoPath.SemiTrust.SharepointListAdapter
type SharepointListAdapterObject = interface
    interface SharepointListAdapter
Public Interface SharepointListAdapterObject
Implements SharepointListAdapter
Attributes
Implements

Examples

<span class="label">SharepointListAdapter</span> SPList = ((<span class="label">SharepointListAdapter</span>)thisXDocument.DataAdapters[“SharePoint list”]);
thisXDocument.UI.Alert(SPList.SiteUrl);
SPList.Query();
  <p>In the following example, a reference to the <strong>SharePointListAdapter</strong> object is accessed through the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.SemiTrust.DataObject.QueryAdapter"></xref> property of a data adapter object by passing the name of the data adapter object to the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.SemiTrust.DataAdapters.Item(System.Object)"></xref> property of the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.SemiTrust.DataAdaptersCollection"></xref> collection:</p>
<span class="label">SharepointListAdapter</span> adapter;
adapter = (<span class="label">SharepointListAdapter</span>) thisXDocument.DataAdapters["Announcements"];
  <p>After the reference has been set, you can use the methods of the <strong>SharePointListAdapter</strong> object as shown in the following example, which re-queries the SharePoint list or library to update the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.SemiTrust.DataObject.DOM"></xref> property of the data adapter object:</p>
  <code>adapter.Query();</code>

Remarks

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 Object Model 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.

Properties

Name

Gets the name of a SharepointListAdapterObject object.

(Inherited from SharepointListAdapter)
QueryAllowed

Gets a value that always returns true, corresponding to the queryAllowed attribute in the form definition file (.xsf).

(Inherited from SharepointListAdapter)
SiteUrl

Gets the Uniform Resource Locator (URL) of the Windows SharePoint Services site that the SharepointListAdapterObject object will query.

(Inherited from SharepointListAdapter)
SubmitAllowed

Gets a value corresponding to the submitAllowed attribute in the form definition file (.xsf).

(Inherited from SharepointListAdapter)

Methods

Query()

Reads data from the associated data adapter.

(Inherited from SharepointListAdapter)
Submit()

Available for the SharepointListAdapterObject, but, because SharePointListAdapter object is available for receiving data only, the method will always generate a run-time error when it is called on that object.

(Inherited from SharepointListAdapter)

Applies to