Interfaccia XMLFileAdapterObject
Rappresenta una connessione a un file XML.
Spazio dei nomi: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)
Sintassi
<GuidAttribute("096cd5d5-0786-11d1-95fa-0080c78ee3bb")> _
<CLSCompliantAttribute(False)> _
<CoClassAttribute(GetType(XMLFileAdapterObjectWrapper))> _
Public Interface XMLFileAdapterObject
Inherits XMLFileAdapter2, XMLFileAdapter
Dim instance As XMLFileAdapterObject
[GuidAttribute("096cd5d5-0786-11d1-95fa-0080c78ee3bb")]
[CLSCompliantAttribute(false)]
[CoClassAttribute(typeof(XMLFileAdapterObjectWrapper))]
public interface XMLFileAdapterObject : XMLFileAdapter2, XMLFileAdapter
Osservazioni
Questo tipo è un wrapper per una coclasse richiesta dal codice gestito per l'interoperabilità COM. Utilizzare questo tipo per accedere ai membri dell'interfaccia COM implementata dalla coclasse. Per informazioni sull'interfaccia COM e un collegamento alle descrizioni dei relativi membri, vedere XMLFileAdapter2.
L'oggetto XMLFileAdapterObject è un tipo di adattatore dati di Microsoft Office InfoPath 2007 che contiene tutte le informazioni necessarie per il recupero dei dati da un'origine dati esterna.
L'oggetto XMLFileAdapterObject rende disponibile la proprietà FileURL, che può essere utilizzata per ottenere o impostare l'URL (Uniform Resource Locator) del file XML utilizzato come origine dati esterna.
Per le origini dati secondarie, è possibile accedere all'oggetto XMLFileAdapterObject tramite la proprietà QueryAdapter dell'oggetto DataSourceObject e tramite la proprietà Item dell'insieme DataAdaptersCollection.
È possibile accedere agli oggetti DataObject tramite la proprietà DataObjects dell'oggetto XDocument.
Esempio
DataAdapters dtaAdapters;
dataAdapters = thisDocument.DataAdapters;
XMLFileAdapterObject queryXMLFile = dataAdapters["form1"] as XMLFileAdapterObject;
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);
}
}
Vedere anche
Riferimenti
Membri XMLFileAdapterObject
Spazio dei nomi Microsoft.Office.Interop.InfoPath.SemiTrust