DAVAdapter.SubmitData(IXMLDOMNode) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Envía el elemento o documento DOM especificado a un adaptador de datos.
public:
void SubmitData(Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ pData);
public void SubmitData (Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode pData);
abstract member SubmitData : Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode -> unit
Public Sub SubmitData (pData As IXMLDOMNode)
Parámetros
- pData
- IXMLDOMNode
Datos XML que se van a enviar.
Ejemplos
En el ejemplo siguiente, el método SubmitData del DAVAdapterObject objeto se usa para enviar un documento XML que contiene un elemento DOM, my:group1
, a una biblioteca de documentos de Windows SharePoint Server. Este código requiere una conexión de datos de la biblioteca de formularios de SharePoint denominada "Submit" y que my:group1
exista en el origen de datos bajo el elemento document, por ejemplo, my:myFields
.
// Get the first data adapter; a "SharePoint Library" submit adapter
DAVAdapter davAdapter = thisXDocument.DataAdapters["Submit"] as DAVAdapter;
if (davAdapter == null)
{
thisXDocument.UI.Alert("SharePoint submit list adapter called 'Submit' was not found.");
return;
}
// Set the file name to be the today's date (as an .xml file)
davAdapter.FileName = DateTime.Today.ToShortDateString() + ".xml";
// Get my:group1 from the data source
IXMLDOMNode group1Node = thisXDocument.DOM.selectSingleNode("/my:myFields/my:group1");
// Check if group1 exists
if (group1Node != null)
{
if (davAdapter.SubmitAllowed)
{
try
{
davAdapter.<span class="label">SubmitData</span>(group1Node);
}
catch (Exception ex)
{
// The save failed
thisXDocument.UI.Alert("Saving to " + davAdapter.FolderURL + " as " + davAdapter.FileName + " failed." + Environment.NewLine + "Reason: " + ex.Message);
}
}
else
{
thisXDocument.UI.Alert("Submit is not allowed on adapter " + davAdapter.Name + ".");
}
}
else
{
// my:group1 does not exist
thisXDocument.UI.Alert("my:group1 does not exist in the form.");
}
Se aplica a
Comentarios
https://aka.ms/ContentUserFeedback.
Próximamente: A lo largo de 2024 iremos eliminando gradualmente GitHub Issues como mecanismo de comentarios sobre el contenido y lo sustituiremos por un nuevo sistema de comentarios. Para más información, vea:Enviar y ver comentarios de