Modifica

Condividi tramite


XMLFileAdapterObject Interface

Definition

Represents a connection to an XML file.

public interface class XMLFileAdapterObject : Microsoft::Office::Interop::InfoPath::XMLFileAdapter2
[System.Runtime.InteropServices.Guid("096CD5D5-0786-11D1-95FA-0080C78EE3BB")]
public interface XMLFileAdapterObject : Microsoft.Office.Interop.InfoPath.XMLFileAdapter2
type XMLFileAdapterObject = interface
    interface XMLFileAdapter2
Public Interface XMLFileAdapterObject
Implements XMLFileAdapter2
Derived
Attributes
Implements

Examples

DataAdapters dtaAdapters;
dataAdapters = thisDocument.DataAdapters; 
<span class="label">XMLFileAdapterObject</span> queryXMLFile = dataAdapters["form1"] as <span class="label">XMLFileAdapterObject</span>;
if (queryXMLFile == null)
{
 thisXDocument.UI.Alert("The DataAdapter does not exist or is not an XMLFileAdapterObject.");
}
else
{
 thisDocument.UI.Alert("Query - XML file adapter"); 
 thisDocument.UI.Alert("Name: " + queryXMLFile.Name);
 thisDocument.UI.Alert("QueryAllowed: " + queryXMLFile.QueryAllowed);
 thisDocument.UI.Alert("SubmitAllowed: " + queryXMLFile.SubmitAllowed);
 thisDocument.UI.Alert("FileURL: " + queryXMLFile.FileURL);
 // Perform the query.
 try
 {
  queryXMLFile.Query();
 }
 catch (Exception ex)
 {
  thisXDocument.UI.Alert("Failed to query.\n\n" + ex.Message);
 }
 // Perform the submit.
 try
 {
  queryXMLFile.Submit();
 }
 catch (Exception ex)
 {
  thisXDocument.UI.Alert("Failed to submit.\n\n" + ex.Message);
 }
}

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

The XMLFileAdapterObject object is a type of Microsoft Office InfoPath 2003 data adapter that contains all the information necessary for retrieving data from an external data source.

The XMLFileAdapterObject object provides the FileURL property, which can be used get or set the Uniform Resource Locator (URL) of the XML file that is being used an external data source.

For secondary data sources, the XMLFileAdapterObject object is accessible through the QueryAdapter property of the DataSourceObject, and the Item[Object] property of the DataAdaptersCollection collection.

DataObject objects are accessible through the DataObjects property of the XDocument object.

Properties

FileURL

Gets or sets the Uniform Resource Locator (URL) of the XML file that is associated with the XMLFileAdapterObject object.

(Inherited from XMLFileAdapter2)
Name

Gets the name of an XMLFileAdapterObject object.

(Inherited from XMLFileAdapter2)
QueryAllowed

Always returns true.

(Inherited from XMLFileAdapter2)
SubmitAllowed

Always returns false.

(Inherited from XMLFileAdapter2)

Methods

Query()

Reads data from the associated data adapter.

(Inherited from XMLFileAdapter2)
Submit()

The Submit method is available for the XMLFileAdapterObject object but, because the XMLFileAdapter 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 XMLFileAdapter2)

Applies to