XMLFileAdapterObject (Interfaz)
Representa una conexión a un archivo XML.
Espacio de nombres: Microsoft.Office.Interop.InfoPath
Ensamblado: Microsoft.Office.Interop.InfoPath (en microsoft.office.interop.infopath.dll)
Sintaxis
<CoClassAttribute(GetType(XMLFileAdapterObjectClass))> _
<GuidAttribute("096CD5D5-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface XMLFileAdapterObject
Inherits XMLFileAdapter2
Dim instance As XMLFileAdapterObject
[CoClassAttribute(typeof(XMLFileAdapterObjectClass))]
[GuidAttribute("096CD5D5-0786-11D1-95FA-0080C78EE3BB")]
public interface XMLFileAdapterObject : XMLFileAdapter2
Comentarios
Este tipo es un contenedor para una coclase que necesita el código administrado para su interoperabilidad COM. Use este tipo para obtener acceso a los miembros de la interfaz COM implementada por esta coclase. Para obtener información sobre la interfaz COM, así como un vínculo a descripciones de sus miembros, vea XMLFileAdapter2.
El objeto XMLFileAdapterObject es un tipo de adaptador de datos de Microsoft Office InfoPath 2003 que contiene toda la información necesaria para recuperar datos de un origen de datos externo.
El objeto XMLFileAdapterObject proporciona la propiedad FileURL, que se puede utilizar para obtener o establecer la dirección URL del archivo XML utilizado como origen de datos externo.
Para orígenes de datos secundarios, se tiene acceso al objeto XMLFileAdapterObject a través de las propiedades QueryAdapter de DataSourceObject y Item de la colección DataAdaptersCollection.
Se puede tener acceso a los objetos DataObject mediante la propiedad DataObjects del objeto XDocument .
Ejemplo
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);
}
}
Vea también
Referencia
XMLFileAdapterObject (Miembros)
Microsoft.Office.Interop.InfoPath (Espacio de nombres)