編輯

共用方式為


SharepointListAdapterObject Interface

Definition

Represents a connection to a SharePoint list or document library.

public interface class SharepointListAdapterObject : Microsoft::Office::Interop::InfoPath::SharepointListAdapter
[System.Runtime.InteropServices.Guid("096CD69A-0786-11D1-95FA-0080C78EE3BB")]
public interface SharepointListAdapterObject : Microsoft.Office.Interop.InfoPath.SharepointListAdapter
type SharepointListAdapterObject = interface
    interface SharepointListAdapter
Public Interface SharepointListAdapterObject
Implements SharepointListAdapter
Derived
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.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.DataAdapters.Item(System.Object)"></xref> property of the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.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.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, seeSharepointListAdapter2.

The SharePointListAdapter object represents the Office 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